
Originally Posted by
mohd9876
you can do something like this:
Thanks mohd
I did have to remove On Error GoTo 0 but it is now working.
I also added line to try to identify which sheet is missing. I added this before error message as below:
So now it looks like this:
This message to identify which sheet is missing is almost working. Let me explain. Lets say I have the following values as below within that named range:
M60
M61
M62
M66
M80
M85
Now in my other workbook I removed sheet M62 and I ran the code. It prompted me with error saying that Sheet "M61" is missing.
I repeated the same process but this time I removed M80 and this time it prompted with error saying that Sheet "M66" is missing.
So essentially it remembers ws1 = as the previous sheet name before it errors out. I did couple examples and its always the same. So I was wondering how to achieve the following:
Could I somehow tie ws1 or string value ThisSht and ask VBA to look through the named range, match this value, and pick the next one in line as a match and Message me the sheet that is missing?
So lets say if M80 is missing it will error out, and essentially ws1 would equal with M66. So now the code would look the list through and pick the next value after M66 which would be M80 in this case, and this happens to be the sheet that is missing.
It would be awesome feat to have. If user has made a mistake then it would be clear where the problem is.
Any feedback would be much appreciated.
Cheers
Bookmarks