ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Editing multiple controlsource references (https://www.excelbanter.com/excel-programming/436740-editing-multiple-controlsource-references.html)

Roger on Excel

Editing multiple controlsource references
 
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?

Jacob Skaria

Editing multiple controlsource references
 
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
---------------
Jacob Skaria


"Roger on Excel" wrote:

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?



All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com