Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
can a variable be used as a control name?
Dim i As Integer Dim cnDayLabel As Control 'or should this be as a String? For i = 1 To 7 cnDayLabel = "DayLabel" & i cnDayLabel.Visible = False Next i |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mark,
If they are control toolbox con trols, use Dim cnDayLabel As OLEObject 'or should this be as a String? For i = 1 To 7 Set cnDayLabel = ActiveSheet.OLEObjects("DayLabel" & i) cnDayLabel.Visible = False Next i If they forms controls, use Dim i As Integer Dim cnDayLabel As Shape For i = 1 To 7 Set cnDayLabel = ActiveSheet.Shapes("DayLabel" & i) cnDayLabel.Visible = False Next i -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "mark kubicki" wrote in message ... can a variable be used as a control name? Dim i As Integer Dim cnDayLabel As Control 'or should this be as a String? For i = 1 To 7 cnDayLabel = "DayLabel" & i cnDayLabel.Visible = False Next i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Passing variable values to userform control | Excel Discussion (Misc queries) | |||
VLOOKUP Returns Erroneous Value When Control Data is Variable | Excel Worksheet Functions | |||
Variable control tip text | Excel Discussion (Misc queries) | |||
Today variable to calender control | Excel Discussion (Misc queries) | |||
Variable Control Names | Excel Programming |