M
Minitman
Greetings,
I have a set of named ranges named rInput1 thru rInput31 (days of the
month). I need to go to the top left cell inside these ranges and
count down to the row of interest (shown as I_1.value). I was using
this code to copy the contents of 105 TextBoxes to this row within the
chosen named range.
----------------------------------------------------------------------------------------------
For i = 2 To 105
Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value
Next i
----------------------------------------------------------------------------------------------
iTD is the day and Range("rInput" & iTD) is supposed to be the named
range for that day. Debug shows the value of iTD to be correct but
when I combine it with the rest of the name for that named range, I
keep getting this error message:
----------------------------------------------------------------------------------------------
Run-time error '1004':
Method 'Range' of object '_Global' failed.
----------------------------------------------------------------------------------------------
iTD is assigned in the UserForm_Initialize procedure.
This is the code debug high lighted:
Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value
Anyone see what is wrong with this code???
Any help is really appreciated.
-Minitman
I have a set of named ranges named rInput1 thru rInput31 (days of the
month). I need to go to the top left cell inside these ranges and
count down to the row of interest (shown as I_1.value). I was using
this code to copy the contents of 105 TextBoxes to this row within the
chosen named range.
----------------------------------------------------------------------------------------------
For i = 2 To 105
Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value
Next i
----------------------------------------------------------------------------------------------
iTD is the day and Range("rInput" & iTD) is supposed to be the named
range for that day. Debug shows the value of iTD to be correct but
when I combine it with the rest of the name for that named range, I
keep getting this error message:
----------------------------------------------------------------------------------------------
Run-time error '1004':
Method 'Range' of object '_Global' failed.
----------------------------------------------------------------------------------------------
iTD is assigned in the UserForm_Initialize procedure.
This is the code debug high lighted:
Range("rInput" & iTD).Cells(I_1.Value, 1).Offset(0, i).Value _
= Me.Controls("I_" & i).Value
Anyone see what is wrong with this code???
Any help is really appreciated.
-Minitman