ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Printing if a cell is blank (https://www.excelbanter.com/excel-programming/320285-printing-if-cell-blank.html)

martin

Printing if a cell is blank
 
I have some code that selects sheets by sheet name. But I
also want to select some other sheets if they are not
blank. The user will click on a button to do this and then
I want to print all those sheets selected. I can do all
of this apart from selecting the sheets that are not blank
Can anyone help?

Thanks,

Martin

david mcritchie

Printing if a cell is blank
 
Hi Martin,
There is a conflict between the subject and text in the body.
But since you say you know how the handle the rest, the part
you are looking for is probably one of the following:

If you want the equivalent of a single cell checked to see if
it is blank (or not blank) use ISEMPTY(...) in VBA for the
equivalent of ISBLANK(...) Worksheet Function.

If you want to see if there is any constant data anywhere on the sheet
IF Cells.SpecialCells(xlConstants).Count < 0 then ...

For those that want to know how to cycle through a selection
of worksheets see http://www.mvps.org/dmcritchie/excel/insrtrow.htm
look for modification by Gary Brown
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Martin" wrote...
I have some code that selects sheets by sheet name. But I
also want to select some other sheets if they are not
blank. The user will click on a button to do this and then
I want to print all those sheets selected. I can do all
of this apart from selecting the sheets that are not blank





All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com