BlackieHamel
Board Regular
- Joined
- May 9, 2014
- Messages
- 93
I have a macro that reports how many rows have data in Column A of a subsidiary worksheet. The code is
Thus if the cell to the left says "BUY" I get the number of rows with data in worksheet BUY.
My problem is that if BUY does not exist, it reports 1, not 0. Some worksheets do have just one row in them, so this leads to confusion: is there just one, or does the sheet not exist?
How can I adjust this to report that the sheet does not exist?
Thanks.
Blackie
Code:
ActiveCell.FormulaR1C1 = "=counta(indirect(RC[-1] & ""!A:A""))"
Thus if the cell to the left says "BUY" I get the number of rows with data in worksheet BUY.
My problem is that if BUY does not exist, it reports 1, not 0. Some worksheets do have just one row in them, so this leads to confusion: is there just one, or does the sheet not exist?
How can I adjust this to report that the sheet does not exist?
Thanks.
Blackie