H
hemants
Its very simple but i keep getting runtime errors!!!
Here is my code:
sub test()
Dim i, x, y, z As Variant
Dim w As String
Dim chr(100) As String
Dim num1(100) As Integer
Dim num2(100) As Integer
Dim num3(100) As Integer
Sheets("TEST TSC").Select
-Range("A1").Select *<---------------- Run-time error '1004'*-
w = ActiveCell.Value
Sheets("Jan FTR").Select
Range("A1").Select
Range("E:E").Find(What:=w, Lookat:=xlWhole, LookIn:=xlValues).Select
ActiveCell.Offset(0, 2).Select
Do
chr(i) = ActiveCell.Value
num1(i) = ActiveCell.Offset(0, 1).Value
num2(i) = ActiveCell.Offset(0, 2).Value
num3(i) = ActiveCell.Offset(0, 3).Value
ActiveCell.Offset(1, 0).Select
i = i + 1
Loop While ActiveCell.Offset(0, -2).Value = ""
Sheets("TEST TSC").Select
Range("A6").Select
i = 0
Do While ActiveCell.Value <> ""
If chr(i) = ActiveCell.Value Then
ActiveCell.Offset(0, 3).Value = num1(i)
ActiveCell.Offset(0, 4).Value = num2(i)
ActiveCell.Offset(0, 6).Value = num3(i)
ActiveCell.Offset(1, 0).Select
i = i + 1
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
end sub
What can i do to fix this?????
If i comment it out, the error occurs on all the "Range" commands!!!
Here is my code:
sub test()
Dim i, x, y, z As Variant
Dim w As String
Dim chr(100) As String
Dim num1(100) As Integer
Dim num2(100) As Integer
Dim num3(100) As Integer
Sheets("TEST TSC").Select
-Range("A1").Select *<---------------- Run-time error '1004'*-
w = ActiveCell.Value
Sheets("Jan FTR").Select
Range("A1").Select
Range("E:E").Find(What:=w, Lookat:=xlWhole, LookIn:=xlValues).Select
ActiveCell.Offset(0, 2).Select
Do
chr(i) = ActiveCell.Value
num1(i) = ActiveCell.Offset(0, 1).Value
num2(i) = ActiveCell.Offset(0, 2).Value
num3(i) = ActiveCell.Offset(0, 3).Value
ActiveCell.Offset(1, 0).Select
i = i + 1
Loop While ActiveCell.Offset(0, -2).Value = ""
Sheets("TEST TSC").Select
Range("A6").Select
i = 0
Do While ActiveCell.Value <> ""
If chr(i) = ActiveCell.Value Then
ActiveCell.Offset(0, 3).Value = num1(i)
ActiveCell.Offset(0, 4).Value = num2(i)
ActiveCell.Offset(0, 6).Value = num3(i)
ActiveCell.Offset(1, 0).Select
i = i + 1
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
end sub
What can i do to fix this?????
If i comment it out, the error occurs on all the "Range" commands!!!