A resource for users and developers of Microsoft Excel |
|||||||||
| Email us your FAQ suggestion. |
|||||||||
Visit often ! Pages are updated daily. |
|||||||||
This is the Excel "How to" Frequently Asked Questions page |
|||||||||
Answers to Frequently Asked Questions about how to do common tasks in Microsoft Excel. |
|||||||||
Excel "How to" FAQs |
| How to verify if a certain worksheet exists; create if not? |
| VBA |
There are three scenarios usually associated with this question. Scenario #1 - Simply yes or no, does a certain worksheet name exist in the active workbook? Sub TestSheetYesNo() Scenario #2 - Does a certain worksheet name exist in the active workbook, and if not, add a new worksheet with that name? Sub TestSheetCreate() Scenario #3 - Add a new worksheet with a certain name, whether or not that worksheet name currently exists. In this scenario, if a worksheet named (for this example) Sheet4 exists, we need to delete it, then create a new worksheet named Sheet4. Sub CreateSheet()
|