A
anon
Hi,
I have two (related issues). Firstly that I have 12 user forms, each
with upwards of 600 text boxes (yes i'm creating a calendar!). Each of
these needs the control source setting. This is issue 1!
To solve this I figured the easiest way was to name these textboxes in
numerical order and then programatically set the control source.
(naming them still takes ages but i think it's the better choice!)
So my text boxes are named T45, T46, T47 etc and the controlsource
therefore needs to be set to Sheet4!g45, sheet4!g46, sheet4!g47 etc
So i quickly wrote the below code, which runs fine but does nothing to
change the controlsource of the textboxes! Grrrr!
Private Sub UserForm_Initialize()
Dim i, ctrl, srce, K
K = 70
For i = 45 To 99
srce = ("Sheet4!g" & K)
ctrl = ("T" & i)
Debug.Print ctrl
Debug.Print srce
Me.Controls(ctrl).ControlSource = (srce)
K = K + 1
Next i
Can anybody suggest why this is doing absolutely NOTHING?! Thanks in
advance
I have two (related issues). Firstly that I have 12 user forms, each
with upwards of 600 text boxes (yes i'm creating a calendar!). Each of
these needs the control source setting. This is issue 1!
To solve this I figured the easiest way was to name these textboxes in
numerical order and then programatically set the control source.
(naming them still takes ages but i think it's the better choice!)
So my text boxes are named T45, T46, T47 etc and the controlsource
therefore needs to be set to Sheet4!g45, sheet4!g46, sheet4!g47 etc
So i quickly wrote the below code, which runs fine but does nothing to
change the controlsource of the textboxes! Grrrr!
Private Sub UserForm_Initialize()
Dim i, ctrl, srce, K
K = 70
For i = 45 To 99
srce = ("Sheet4!g" & K)
ctrl = ("T" & i)
Debug.Print ctrl
Debug.Print srce
Me.Controls(ctrl).ControlSource = (srce)
K = K + 1
Next i
Can anybody suggest why this is doing absolutely NOTHING?! Thanks in
advance