SIMPLE UserForm w/ 2 OPTION BUTTONS

  • Thread starter Thread starter Chuckles123
  • Start date Start date
C

Chuckles123

I am a somewhat newbie to VBA. How would you add constants for strin
values?
Chuckles12
 
For your code I would do something like

Public Const sOption1 As String = "EVAL"
Public Const sOption2 As String = "BID"

Public Button As String
Sub CREATE_FORM()
'
frmPricing.Show
'SHOW Pricing UserForm ON DISPLAY

'USER SELECTS BUTTON

'AFTER SELECTION, CONTROL COMES BACK HERE
If Button = sOption1 Then
Range("A1").Select

ElseIf ton = sOption2 Then
Range("C1").Select

Else
Msgbox "Error in selection"

End If

End Sub

'BELOW IS CODE FOR EACH OF 2 OPTION BUTTONS

Private Sub optEVAL_Prices_Click()
Button = sOption1
Unload Me
End Sub

Private Sub optBID_Prices_Click()
Button = sOptions2
Unload Me
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top