Hi,
I have a macro that references a radio button named "WaiverPrintingONOB" on another worksheet named "Administrator". It doesn't seem to reference it properly though because when the value is true the msgbox still appears.
Can anyone help me reference the button properly?If Sheets("Administrator").OptionButtons("WaiverPrintingONOB").Value = True Then FR_or_ENForm.Show Else MsgBox "It works!", vbDefaultButton1, "Test" End If
Thanks
Last edited by Einstahb; 10-30-2011 at 09:02 AM.
Are you using an ActiveX radio button? (It would help to attach your workbook.) I would have done this, but I'm not sure what your problem is:
If Sheets("Administrator").WaiverPrintingONOB Then FR_or_ENForm.Show Else MsgBox "It works!", vbDefaultButton1, "Test" End If
Making the world a better place one fret at a time
||||||
If someone helped you, please click on the star icon at the bottom of their post
If your problem is solved, please update the first post:
EDIT, Go Advanced button, set Prefix to SOLVED
[code]
' Enclose code in tags like this
[/code]
Don't attach a screenshot--just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.
Hi,
Thanks for the reply. The code you provided still doesn't seem to work. I've attached a file with the function.The radio button is on the "administrator" page. The command button that runs the macro is on the "Waiver" page.
Joel
You are using the older "form" controls. My advice was for ActiveX controls.
A form control radio button has a value of 1 if it's on, and -4146 if it's off (don't ask me). So you could go back to your original code, checking for those values.
Thanks for your help. With the proper value, the code works perfectly!
If Sheets("Administrator").OptionButtons("WaiverPrintingONOB").Value = 1 Then FR_or_ENForm.Show Else MsgBox "It works!", vbDefaultButton1, "Test" End If
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks