Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
107I am a rookie excel programmer trying to display data from a worksheet to
textboxes which I thought to be a very simple operation but Excel just ignores the instuctions i.e Dim Rw As Integer Rw = 2 TextBox1.Text = Sheet1.Cells(rw,1) Any help will be appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Your code will work if it is on the same sheet as the textbox, if as you say
it is being ignored without any errors I suspect the code is working, the reference you are creating is to Row 2, Column 1, e.g. cell A2, have you anything in cell A2? if not then the code will load "empty" and nothing will change in the control. You could fully specify the location of the Textbox, the following example will work on the sheet code and a standard module. Sub myCode() Dim Rw As Integer Rw = 2 With Sheet1 .TextBox1.Text = .Cells(Rw, 1) End With End Sub -- Regards, Nigel "Lyndon107" wrote in message ... 107I am a rookie excel programmer trying to display data from a worksheet to textboxes which I thought to be a very simple operation but Excel just ignores the instuctions i.e Dim Rw As Integer Rw = 2 TextBox1.Text = Sheet1.Cells(rw,1) Any help will be appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the info. NIgel.
Unfortunately your suggestion did not work and I felt that I had not given enough information. My information is on a worksheet and I am trying to take information from the worksheet and place it into textboxes on a userform which is loaded from a standard module. When I tried your example Excel told me it could not find Textbox1 I am struggling with this for the past four days so if you can spear the time I would certainly appreciate your further help. lyndon107 "Nigel" wrote: Your code will work if it is on the same sheet as the textbox, if as you say it is being ignored without any errors I suspect the code is working, the reference you are creating is to Row 2, Column 1, e.g. cell A2, have you anything in cell A2? if not then the code will load "empty" and nothing will change in the control. You could fully specify the location of the Textbox, the following example will work on the sheet code and a standard module. Sub myCode() Dim Rw As Integer Rw = 2 With Sheet1 .TextBox1.Text = .Cells(Rw, 1) End With End Sub -- Regards, Nigel "Lyndon107" wrote in message ... 107I am a rookie excel programmer trying to display data from a worksheet to textboxes which I thought to be a very simple operation but Excel just ignores the instuctions i.e Dim Rw As Integer Rw = 2 TextBox1.Text = Sheet1.Cells(rw,1) Any help will be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
populate cell on worksheet 2 if text is red on worksheet 1 | Excel Worksheet Functions | |||
Best way to populate worksheet from 2 combo boxes | Excel Worksheet Functions | |||
INDEX/MATCH formula in VBA to populate text boxes | Excel Programming | |||
Having data populate text boxes based on Combobox Value | Excel Programming | |||
Populate Userform text boxes in VBA with VLookup data from #2 worksheet | Excel Programming |