jazznaura
10-04-2014, 08:27 AM
hi all,
need some help with a vlookup on an array,
below is what i have but can't figure out the vlookup, get a 'Object doesnt support this method or property' error
have used similar in excel when entered into cell but never tried in vba and with an array.
Any help would be great.
thanks
jazz,
OR04array() = Import.Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(, 7)).Value
FR10Xarray() = Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(, 5)).Value
For I = LBound(OR04array, 1) To UBound(OR04array, 1)
OR04array(I, 4) = WorksheetFunction.IF(WorksheetFunction.VLookup(OR04array(I, 1), FR10Xarray(), 1, True) = OR04array(I, 1), WorksheetFunction.VLookup(OR04array(I, 1), FR10Xarray(), 3, True), "None")
Next I
Range("J1").Resize(UBound(OR04array, 1), UBound(OR04array, 2)).Value = OR04array
Erase OR04array()
Erase FR10Xarray()
need some help with a vlookup on an array,
below is what i have but can't figure out the vlookup, get a 'Object doesnt support this method or property' error
have used similar in excel when entered into cell but never tried in vba and with an array.
Any help would be great.
thanks
jazz,
OR04array() = Import.Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(, 7)).Value
FR10Xarray() = Range("A1", Range("A" & Rows.Count).End(xlUp).Offset(, 5)).Value
For I = LBound(OR04array, 1) To UBound(OR04array, 1)
OR04array(I, 4) = WorksheetFunction.IF(WorksheetFunction.VLookup(OR04array(I, 1), FR10Xarray(), 1, True) = OR04array(I, 1), WorksheetFunction.VLookup(OR04array(I, 1), FR10Xarray(), 3, True), "None")
Next I
Range("J1").Resize(UBound(OR04array, 1), UBound(OR04array, 2)).Value = OR04array
Erase OR04array()
Erase FR10Xarray()