still learning VBA and frequently bumping up to some errors. I currently have the following issue:
I have an excel with 2 worksheets (FORM and DATA).
sheet DATA contains 2 colums of data: A = lookup value. B = value to be returned. Range (A:B) is named data.
sheet FORM column B contains the lookup value (identical to DATA colum A). The number of rows for this column is variable, starting from B2.
Column C is empty and should receive a vlookup-formula via macro if the corresponding cel in column B is not empty.
I currently have the following:
Dim lR as long
lR= Range("B" & rows.count).end(x1up).row
range("C2").Formula= "=VLOOKUP(B2;data;2;FALSE)"
range("C2:C" & Range("B" & Rows.Count).end(x1up).row).filldown
when running the macro, I receive the error: application-defined or object-defined error.
I have an excel with 2 worksheets (FORM and DATA).
sheet DATA contains 2 colums of data: A = lookup value. B = value to be returned. Range (A:B) is named data.
sheet FORM column B contains the lookup value (identical to DATA colum A). The number of rows for this column is variable, starting from B2.
Column C is empty and should receive a vlookup-formula via macro if the corresponding cel in column B is not empty.
I currently have the following:
Dim lR as long
lR= Range("B" & rows.count).end(x1up).row
range("C2").Formula= "=VLOOKUP(B2;data;2;FALSE)"
range("C2:C" & Range("B" & Rows.Count).end(x1up).row).filldown
when running the macro, I receive the error: application-defined or object-defined error.