L
Les
Hi all, i have got the following code that i need to loop with can somebody
please show me how to alter the code....
It works great except i need it to loop down all numbers in column A which
will be variable in length
Sub VLUp()
Dim LookUpTable As Range, LookUpCell As Range
Dim res As String, myRange As Range
Set LookUpTable =
Workbooks("PU0907LCS.xls").Worksheets("LCS").Range("LCS")
Set LookUpCell = Workbooks("90IH0709.xls").Worksheets("KTL").Range("A10")
res = Application.VLookup(LookUpCell.Value, LookUpTable, 7, False)
ActiveCell = res
res = Application.VLookup(LookUpCell.Value, LookUpTable, 2, False)
ActiveCell.Offset(0, 2) = res
res = Application.VLookup(LookUpCell.Value, LookUpTable, 8, False)
ActiveCell.Offset(0, 3) = res
End Sub
please show me how to alter the code....
It works great except i need it to loop down all numbers in column A which
will be variable in length
Sub VLUp()
Dim LookUpTable As Range, LookUpCell As Range
Dim res As String, myRange As Range
Set LookUpTable =
Workbooks("PU0907LCS.xls").Worksheets("LCS").Range("LCS")
Set LookUpCell = Workbooks("90IH0709.xls").Worksheets("KTL").Range("A10")
res = Application.VLookup(LookUpCell.Value, LookUpTable, 7, False)
ActiveCell = res
res = Application.VLookup(LookUpCell.Value, LookUpTable, 2, False)
ActiveCell.Offset(0, 2) = res
res = Application.VLookup(LookUpCell.Value, LookUpTable, 8, False)
ActiveCell.Offset(0, 3) = res
End Sub