Attaching Macros to Form ComboBox Control
Posted by Clinton Hayes on August 29, 2001 4:03 AM
Hi...I hope someone can help.
I'm just learning the difference between ComboBoxes as a Forms control and as a VBA (Active X) control. Whilst the forms control gives me almost everything I need, as I don't want the ComboBox to print under certain conditions, I have to write some code to address this.
If I use a Forms control, I need to attach a Macro to run the code and I'm having trouble with this. If I use a VBA control, it's not as simple for me as it doesn't provide me with Input range or the cell link and I'm not sure how to add my data etc.
When I try to run the Macro for the Forms control, it gives me a 424 runtime error saying that an object is required. The code I'm trying to run is:
If DropDown26 = "N/A" Then
DropDown26.PrintObject = False
Else
DropDown.PrintObject = True
End If
I call it a Drop Down 'cause that's what Excel calls it but I've tried ComboBox and I get the same result. This is probably pretty simple to someone who know but I'm stuck.
Anybody want to assist?
Thanks,
Clinton.