Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, I am trying to get the follow function to work with no success and looking for some help.
effectively what I am trying to achieve is, if a value is added to a cell in column 19, a vlookup is performed and the result added to column 17.
option compare text
private sub worksheetChange (byval target as range)
dim lastrowcolumnb as long
lastrowcolumnb = range (“p” & rows.count).end(xl up).row
for b = 2 or lastrowcolumnb
if instr(1. cells (b,19),”<>”)>0 then
cells(B,17)=application.worksheet function.vlookup(cells(b,19),sheets(“active rm”).range(“a:c”),2,false)
else
end if
next
sub end
currently with cells b,19 set to look for non blank, it returns nothing.
if I change it to a value held in the active rm sheet, I get an method range of object_worksheet failed on the vlookup
but can’t see thing wrong.
any tips or alternative methods would be appreciated.
effectively what I am trying to achieve is, if a value is added to a cell in column 19, a vlookup is performed and the result added to column 17.
option compare text
private sub worksheetChange (byval target as range)
dim lastrowcolumnb as long
lastrowcolumnb = range (“p” & rows.count).end(xl up).row
for b = 2 or lastrowcolumnb
if instr(1. cells (b,19),”<>”)>0 then
cells(B,17)=application.worksheet function.vlookup(cells(b,19),sheets(“active rm”).range(“a:c”),2,false)
else
end if
next
sub end
currently with cells b,19 set to look for non blank, it returns nothing.
if I change it to a value held in the active rm sheet, I get an method range of object_worksheet failed on the vlookup
but can’t see thing wrong.
any tips or alternative methods would be appreciated.