Editing multiple controlsource references

R

Roger on Excel

I need to edit 100's of textbox ControlSource references :

for example for textbox1 the ControlSource is Sheet1!a1 and for textbox2 the
ControlSource is Sheet1!a2 etc etc etc...

it could take me days to do this manually - there must be a quicker way?
 
J

Jacob Skaria

Try the below for the range ..textbox1 to textbox10

Private Sub UserForm_Initialize()
Dim intCount as Integer
For intCount = 1 To 10
UserForm1.Controls("Textbox" & intCount).ControlSource = "Sheet1!A" & intCount
Next
End Sub

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top