General Ledger
Active Member
- Joined
- Dec 31, 2007
- Messages
- 460
Dear All,
In an Excel 2003 workbook, I have several sheets. On one sheet I have Option Buttons. I am trying to change the value (true or false) of the buttons with code in a VBA module.
I had code in Module1 to set the value of an Option Button:
OptButInternational.Value = False
I get a run-time error '424' object required.
I am thinking you can only change a property of a control using code in the sheet where the control is. Correct?
I put a bit of code in the sheet:
Sub OptButInternationalFalse()
OptButInternational.Value = False
End Sub
When I run this code from the VBE in the sheet, it works fine.
In Module1 I put code to call the sub:
Call OptButInternationalFalse
When I run the code in the Module, I immediately get and error:
Compile error: Sub or Function not definded
Is the problem that code in Module1 can not call a sub in a sheet?
Any ideas or options?
Thanks,
GL
In an Excel 2003 workbook, I have several sheets. On one sheet I have Option Buttons. I am trying to change the value (true or false) of the buttons with code in a VBA module.
I had code in Module1 to set the value of an Option Button:
OptButInternational.Value = False
I get a run-time error '424' object required.
I am thinking you can only change a property of a control using code in the sheet where the control is. Correct?
I put a bit of code in the sheet:
Sub OptButInternationalFalse()
OptButInternational.Value = False
End Sub
When I run this code from the VBE in the sheet, it works fine.
In Module1 I put code to call the sub:
Call OptButInternationalFalse
When I run the code in the Module, I immediately get and error:
Compile error: Sub or Function not definded
Is the problem that code in Module1 can not call a sub in a sheet?
Any ideas or options?
Thanks,
GL