ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting Worksheets (https://www.excelbanter.com/excel-programming/397504-counting-worksheets.html)

jnf40

Counting Worksheets
 
Is there a way to have the workbook count sheets and then have a message pop
up when it reaches a certain number?

Mike Fogleman

Counting Worksheets
 
Something like this put in the ThisWorkbook code module:

Private Sub Workbook_NewSheet(ByVal Sh As Object)
If Sheets.Count 3 Then MsgBox "Too many sheets."
End Sub

Mike F
"jnf40" wrote in message
...
Is there a way to have the workbook count sheets and then have a message
pop
up when it reaches a certain number?





All times are GMT +1. The time now is 01:58 PM.

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