Linking dynamic Cells in Excel to Form
The controlsource needs Range as a string. So you can do this
Define a Name for the Cell you want as the ContolSource, it will move with inserts
Add this code to your Forms activate event , create more lines for each additional Textboxes
Two caveats:
the .Address will only refer to the ActiveSheet
If you make inserts while form is active it will not show up till Form is Deactvted/Reactivate
Private Sub UserForm_Activate(
Me.TextBox1.ControlSource = Range("DateRange").Addres
End Su
----- Novice wrote: ----
I have created a form that allows the user to enter information that will be displayed into the Excel Spreadsheet, such as a specific date. In the form properties, I set the control source to a cell within the spreadsheet. However, once I add or delete lines in the spreadsheet, the cell linkage within the form does not change dynamically. I have tried to apply Names in the control source. There must be something that will allow this
Any suggestions would be great!
|