Thanks Logit, that is exactly what I want but the code is not working when I pasted it into a module in my main workbook. I do not have any sheets named "sheet1" or "sheet2" which i see in your code so I switched to the actual name of my sheet that needs the vba function, ("Input Page"). As expected it returned all kinds of Debug errors which I tried to resolve. No success.
I noticed part of the code appears to reference sheet2? is see sheet2 of your example has no data in it... why would vba be looking at a sheet with no data?
Bookmarks