Option buttons and Case Select


Posted by Danny on September 05, 2000 4:45 PM

I have a dialog box with 2 Option buttons (BUTTON10 and BUTTON20).

ButtonName = Application.Caller
Select Case ButtonName
Case "BUTTON10"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "RATE"
Case "BUTTON20"
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "SALARY"
Case Else
Exit Sub
End Select

Only one of these buttons can be checked, and I've tried every
suggestion I've found out there to return "RATE" if the first
button is selected, and "SALARY" if the second one's selected
These include If then statements, calling the button:
DialogSheets("NewEmployee").OptionButtons("BUTTON10"), etc. I've
checked the spelling and spacing of the button names/labels, and still
can't get this to work. Can someone tell me what I'm doing wrong,
or how I can make this work? Thanks a million in advance.

Danny



Posted by Danny on September 05, 0100 5:01 PM

Well I found a solution, but it might not be the best.

Here's what I put in that will work:

Select Case DialogSheets("NewEmployee").OptionButtons("BUTTON10").Value
Case Is = 1
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "RATE"
Case Else
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = "SALARY"
End Select
DialogSheets("NewEmployee").OptionButtons("BUTTON10").Value = 1

Does this look pretty ugly? Is there a more fool proof way of doing this?