D
devnext
hi,
i'm trying to use vlookup in vba, bt i can't get it to work. here's the thing:
Dim count As Integer
Dim n As Integer
Dim table As String
Dim look As String
Dim column As Integer
count = Workbooks("BDs").Worksheets("bd_lx").Range("A2").Value
column = 3
For n = 4 To count
look = Workbooks("BDs").Worksheets("bd_lx").Range("B" & n).Value
table = Workbooks("BDs").Worksheets("bd_lx").Range("A" & n).Value
Application.WorksheetFunction.VLookup(look, rg, column, False).Select
Selection.Copy
Range("B:" & n).Select
Selection.End(xlRight).Select
ActiveCell.Offset(1, 0).Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next n
is it 'cause the variable array? and probably is not a range?
how can i put it right?
thanks a million,
i'm trying to use vlookup in vba, bt i can't get it to work. here's the thing:
Dim count As Integer
Dim n As Integer
Dim table As String
Dim look As String
Dim column As Integer
count = Workbooks("BDs").Worksheets("bd_lx").Range("A2").Value
column = 3
For n = 4 To count
look = Workbooks("BDs").Worksheets("bd_lx").Range("B" & n).Value
table = Workbooks("BDs").Worksheets("bd_lx").Range("A" & n).Value
Application.WorksheetFunction.VLookup(look, rg, column, False).Select
Selection.Copy
Range("B:" & n).Select
Selection.End(xlRight).Select
ActiveCell.Offset(1, 0).Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next n
is it 'cause the variable array? and probably is not a range?
how can i put it right?
thanks a million,