Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for TextBox ControlSource Property to another worksheet
I am trying to set a TextBox ControlSource from a UserForm to link to a
different worksheet..... I use the syntax UserForm.TextBoxxxx.ControlSource = Worksheets(#).Range("Cell#") yet when I go to run it I keep getting an error message. What would be the correct syntax for this....or can I even do this with VB??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for TextBox ControlSource Property to another worksheet
Hi
You could try activating the the worksheet before you set the control source this code takes the value from cell a1 on the three sheets of a workbook and shows them in a different textbox each Private Sub CommandButton1_Click() Sheets("sheet1").Activate TextBox1.ControlSource = "A1" Sheets("sheet2").Activate TextBox2.ControlSource = "A1" Sheets("sheet3").Activate TextBox3.ControlSource = "A1" End Sub hope this is of some use to you S jam9663 wrote: I am trying to set a TextBox ControlSource from a UserForm to link to a different worksheet..... I use the syntax UserForm.TextBoxxxx.ControlSource = Worksheets(#).Range("Cell#") yet when I go to run it I keep getting an error message. What would be the correct syntax for this....or can I even do this with VB??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Syntax for TextBox ControlSource Property to another worksheet
try these -
"'" & sheet-name & "'!" & cell.address or mySingleCellRangeObject.address(external:=true) Regards, Peter T "jam9663" wrote in message ... I am trying to set a TextBox ControlSource from a UserForm to link to a different worksheet..... I use the syntax UserForm.TextBoxxxx.ControlSource = Worksheets(#).Range("Cell#") yet when I go to run it I keep getting an error message. What would be the correct syntax for this....or can I even do this with VB??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
TextBox ControlSource | Excel Programming | |||
ControlSource in a userform textbox | Excel Programming | |||
Textbox ControlSource Property - Excel 97 | Excel Programming | |||
last piece of the puzzle...controlsource in textbox | Excel Programming | |||
Problem with TextBox & ControlSource - Please Help | Excel Programming |