Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I seem to be at a lose to be able to get this to write data back to the
worksheet after the the TextBoxes have been edited. Private Sub CommandButton1_Click() Cells(rngArr(0).Row,(1, 7).Value = TextBox1.Value Cells(rngArr(1).Row,(1, 7).Value = TextBox2.Value Cells(rngArr(2).Row,(1, 7).Value = TextBox3.Value End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Two things:
First you have to declare the RngArr() variable as public as below (outside the module), and remove the related Dim statement: Public rngArr() As Range Second you have a syntax error in your macro, if values is to be written back to column 7, then use this: Private Sub CommandButton1_Click() Cells(rngArr(0).Row, 7).Value = Me.TextBox1.Value Cells(rngArr(1).Row, 7).Value = Me.TextBox2.Value Cells(rngArr(2).Row, 7).Value = Me.TextBox3.Value End Sub Regards, Per On 25 Sep., 20:39, "Patrick C. Simonds" wrote: I seem to be at a lose to be able to get this to write data back to the worksheet after the the TextBoxes have been edited. Private Sub CommandButton1_Click() * *Cells(rngArr(0).Row,(1, 7).Value = TextBox1.Value * *Cells(rngArr(1).Row,(1, 7).Value = TextBox2.Value * *Cells(rngArr(2).Row,(1, 7).Value = TextBox3.Value End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I thought about making rngArr() As Range public as well but when I do it I
get the following error: Compile Error Constants, fixed-length strings, arrays, user-defined types and Declare Statements not allowed as Public members or object modules "Per Jessen" wrote in message ... Two things: First you have to declare the RngArr() variable as public as below (outside the module), and remove the related Dim statement: Public rngArr() As Range Second you have a syntax error in your macro, if values is to be written back to column 7, then use this: Private Sub CommandButton1_Click() Cells(rngArr(0).Row, 7).Value = Me.TextBox1.Value Cells(rngArr(1).Row, 7).Value = Me.TextBox2.Value Cells(rngArr(2).Row, 7).Value = Me.TextBox3.Value End Sub Regards, Per On 25 Sep., 20:39, "Patrick C. Simonds" wrote: I seem to be at a lose to be able to get this to write data back to the worksheet after the the TextBoxes have been edited. Private Sub CommandButton1_Click() Cells(rngArr(0).Row,(1, 7).Value = TextBox1.Value Cells(rngArr(1).Row,(1, 7).Value = TextBox2.Value Cells(rngArr(2).Row,(1, 7).Value = TextBox3.Value End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If statement propblem | Excel Discussion (Misc queries) | |||
Propblem setting OnAction property at runtime | Excel Programming |