dear Administrator,
how can i change this code that instead of hard coded values of "|2001|2002|2003|2011|2012|2017|" i used cell reference
for example. my 2001 will be in cell A2 and 2002 will be in A3 and 2003 will be in cell A4 and so on.
i tried this and it did not work If Instr(1,"A2:A7", "|" & ShD.Cells(C.Row, intYearCol).Value & "|") >0
screenshot A
E.png
also how to i change the code if the values are in one cell separated by comma like screenshot B
for the screenshot below i used If Instr(1,"A1", "|" & ShD.Cells(C.Row, intYearCol).Value & "|") >0 and it did not work.
2017-11-24 15_39_07-Book1 - Excel.png




Reply With Quote

Bookmarks