![]() |
using variable for a control name
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 |
using variable for a control name
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 |
All times are GMT +1. The time now is 05:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com