Ron Morris
Active Member
- Joined
- Oct 18, 2004
- Messages
- 430
Hi,
I am trying to load data from one worksshet to another based on criteria in a cell. I used the following code for test purposes but am getting a Run Time Error '1004', Select Method of Range Class Failed. I have read the help feature and as far as i can tell, I meet on the criteria to make this work.
I was using this for test purposes but will need to change to For / Each / Case structure since I will have multiple possibilities.
Any insight to this issue for this newbie would be greatly appreciated.
Thank you,
Ron
I am trying to load data from one worksshet to another based on criteria in a cell. I used the following code for test purposes but am getting a Run Time Error '1004', Select Method of Range Class Failed. I have read the help feature and as far as i can tell, I meet on the criteria to make this work.
Code:
Private Sub cmdtest_click()
Dim routingrow
If Sheets("sheet1").Range("c18").Value = 1 Then
Set routingrow = Sheets("sheet3").Range("A50").End(xlUp)
Sheets("sheet3").Range("A31").Select
routingrow.Offset(1, 0).Value = Sheets("Sheet1").Range("a4").Value
routingrow.Offset(1, 2).Value = Sheets("Sheet1").Range("c4").Value
routingrow.Offset(1, 4).Value = Sheets("Sheet1").Range("d4").Value
routingrow.Offset(1, 5).Value = Sheets("Sheet1").Range("e4").Value
routingrow.Offset(2, 0).Value = Sheets("Sheet1").Range("a4").Value
routingrow.Offset(2, 2).Value = Sheets("Sheet1").Range("g4").Value
routingrow.Offset(2, 4).Value = Sheets("Sheet1").Range("h4").Value
routingrow.Offset(2, 5).Value = Sheets("Sheet1").Range("i4").Value
routingrow.Offset(3, 0).Value = Sheets("Sheet1").Range("a4").Value
routingrow.Offset(3, 2).Value = Sheets("Sheet1").Range("k4").Value
routingrow.Offset(3, 4).Value = Sheets("Sheet1").Range("l4").Value
routingrow.Offset(3, 5).Value = Sheets("Sheet1").Range("m4").Value
End If
End Sub
Any insight to this issue for this newbie would be greatly appreciated.
Thank you,
Ron