Hi Guys,
I have the following code:
Cells(erow, 43).Formula = "=IF(ISNA(VLOOKUP(AY2,Sheet4!$A$1:$B$1000,2,FALSE)),"""",VLOOKUP(AY2,Sheet4!$A$1:$B$1000,2,FALSE))"
What this does as part of a VBA userform is a VLOOKUP using a cell that contains merged data from fields of the form This form is used for adding new products to a spreadsheet and as it is completed and the products saved via the userform, the sheet is populated in the background and when the next product is added it goes on to the next empty row. This is why there are the erow references within there.
The VLOOKUP itself returns a value of nothing if there is no data present which is why it is presented as an IF function.
The sample of code works though what I am having trouble with is that the code that I insert has a lookup reference to cell AY2 and what I need is to reference column AY but I need the row to be relative to the line that it is entered on. Am I able to use wildcards in any way to get what I am after?
Any help that you can offer would be greatly appreciated.
Thanks
Bookmarks