WBURKERT
Technical User
- May 28, 2010
- 73
I am trying to create a dialog box that has just two command buttons - ENGLISH and METRIC. I got the box and the buttons working but clicking on either button fails to exit the sub and then I am not sure how to pass the clicked button's value back to my macro that is nothing more than a bunch of IF THEN statements depending on whether ENGLISH or METRIC was pushed.
Your help is much appreciated.
Sub Data_Change()
Dim UNITS As String
Load frmUNITS
frmUNITS.Show
If UNITS = English Then
Worksheets("RUN 1").Range("E7").Value = "inHg"
Else
Worksheets("RUN 1").Range("E7").Value = "mmHg"
End If
frmUNITS
Private Sub commandButton1_Click()
DIM UNITS As String
If CommandButton1_Click().Value = TRUE Then
UNITS = English
End If
frmUNITS.Hide
End Sub
Private Sub CommandButton2_Click()
If CommandButton2_Click() = TRUE Then
UNITS = METRIC
End If
frmUNITS.Hide
End Sub
Your help is much appreciated.
Sub Data_Change()
Dim UNITS As String
Load frmUNITS
frmUNITS.Show
If UNITS = English Then
Worksheets("RUN 1").Range("E7").Value = "inHg"
Else
Worksheets("RUN 1").Range("E7").Value = "mmHg"
End If
frmUNITS
Private Sub commandButton1_Click()
DIM UNITS As String
If CommandButton1_Click().Value = TRUE Then
UNITS = English
End If
frmUNITS.Hide
End Sub
Private Sub CommandButton2_Click()
If CommandButton2_Click() = TRUE Then
UNITS = METRIC
End If
frmUNITS.Hide
End Sub