ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel - To test for a Blank Sheet (https://www.excelbanter.com/excel-programming/293707-excel-test-blank-sheet.html)

TKT-Tang

Excel - To test for a Blank Sheet
 
Please show the VBA coding required in order to test for a blank
worksheet as well as a blank chart-sheet.
Regards.

Vasant Nanavati

Excel - To test for a Blank Sheet
 
If WorksheetFunction.CountA(Sheet1.Cells) = 0 Then MsgBox "Worksheet is
blank."

Don't know much about charts ... <g

--

Vasant


"TKT-Tang" wrote in message
om...
Please show the VBA coding required in order to test for a blank
worksheet as well as a blank chart-sheet.
Regards.




Tom Ogilvy

Excel - To test for a Blank Sheet
 
One needs to define blank. There can be shapes on the sheet and no cell
entries.

--
Regards,
Tom Ogilvy

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
If WorksheetFunction.CountA(Sheet1.Cells) = 0 Then MsgBox "Worksheet is
blank."

Don't know much about charts ... <g

--

Vasant


"TKT-Tang" wrote in message
om...
Please show the VBA coding required in order to test for a blank
worksheet as well as a blank chart-sheet.
Regards.






Vasant Nanavati

Excel - To test for a Blank Sheet
 
Good point, Tom ... never even thought of that!

Regards,

Vasant.


"Tom Ogilvy" wrote in message
...
One needs to define blank. There can be shapes on the sheet and no cell
entries.

--
Regards,
Tom Ogilvy

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
If WorksheetFunction.CountA(Sheet1.Cells) = 0 Then MsgBox "Worksheet is
blank."

Don't know much about charts ... <g

--

Vasant


"TKT-Tang" wrote in message
om...
Please show the VBA coding required in order to test for a blank
worksheet as well as a blank chart-sheet.
Regards.








TKT-Tang

Excel - To test for a Blank Sheet
 
Mr. Vasant Nanavati and Mr. Tom Ogilvy,

Thank you for your illumination.
A blank worksheet (for my purpose) is primarily devoid of cell entries
; otherwise, there would be required to test for Shapes and Charts
Collections. By extension, there could be (resident already) VBA
Coding and UserForms as well.

How are the items as given detectable by VBA Coding ?

Regards.

Tom Ogilvy

Excel - To test for a Blank Sheet
 
activesheet.shapes.count = 0

Chartobjects are also shapes.

for code, see
http://www.cpearson.com/excel/vbe.htm

there are no userforms in sheets.

--
Regards,
Tom Ogilvy

"TKT-Tang" wrote in message
om...
Mr. Vasant Nanavati and Mr. Tom Ogilvy,

Thank you for your illumination.
A blank worksheet (for my purpose) is primarily devoid of cell entries
; otherwise, there would be required to test for Shapes and Charts
Collections. By extension, there could be (resident already) VBA
Coding and UserForms as well.

How are the items as given detectable by VBA Coding ?

Regards.





All times are GMT +1. The time now is 03:01 AM.

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