I Solved it! - use Me.OLEObjects("OptionButton" & CStr( i)).Visible = False
I am trying to control the visibility of several buttons using a procedure. I want to specify the buttons by name. The name is dynamically constructed at run time within a for loop. I saw the following code fragment online but cannot get it to work in my Excel macros:
So the first iteration would have the effect of OptionButton1.Visible = False
The second iterations would have the effect of OpetionButton2.Visible = False
And so on.
Since the code fragment doesn't work, how can I access an object by dynamically constructing its name at run time? Thanks in advance.
Joe
Bookmarks