Update Data On Sheet From UserForm TextBoxes
you can email it to me if you don't receive a response here.
--
Gary
"Minitman" wrote in message
...
Hey Gary,
Thanks for the response.
What I mean when I said "It doesn't work" is that in this
configuration, the code runs but does not modify the chosen row.
I added the ws. to the Range, but that did not change the way it did
not work. I also tried ws.Range("A" & vRowToModify & ":BS" &
vRowToModify) and that ran but the data was wrong (I changed the value
in the TextBox that went to column P and ALL of the cells in that row
had a 3 instead of the column number - the default for this test)
I have a sample of the workbook with all of the sensitive data removed
if you would like to take a look at it. This was made in Excel 2003.
Zipped it is about 101kb
Let me know, thanks.
-Minitman
On Mon, 30 Jul 2007 02:21:31 -0400, "Gary Keramidas"
wrote:
what do you mean by doesn't work?
you should also qualify the ranges with the sheet name:
dim ws as worksheet
set ws = worksheets("sheet1")
With ws.Range("A65536").End(xlUp)
For i = 1 To 34
.Offset(0, i + 1).Value = Me.Controls("TB" & i + 1).Value
Next i
End With
this works for me i if hard code it to row 6.
Dim ws As Worksheet
Dim vRowToModify As Long
Dim i As Long
Set ws = Worksheets("sheet1")
vRowToModify = 6 'CB1.ListIndex + 1
With ws.Range("A" & vRowToModify) '<<<<<<
For i = 1 To 34
.Offset(0, i + 1).Value = Me.Controls("TextBox" & i + 1).Value
Next i
End With
|