VBA Check if Sheet Exists
I have a solution for checking if an Excel worksheet exists or not. This can come in handy if you are creating a new sheet based on a dataset. You check for the new sheet and if the sheet exists you can alter the old sheet if the sheet does not exist then you can create a new sheet.
If Not Evaluate("ISREF('" & [A1] & "'!A1)") Then
Where Excel cell [A1] contains the name of the sheet you are checking for.
Now if this procedure was part of a loop you may wish to check all of the cells from say A1 to the last used row in column A. Then the following might be more relevant.
Read MoreFeatured Posts
Recent Posts
Split File into Parts and Save to Directory April 20, 2024
Most Popular Author December 14, 2023
Creating an Excel Dashboard - A Guide with Templates December 8, 2023
Real Estate Excel Dashboard October 11, 2023
Updating Excel Dashboards September 29, 2023
TheSmallman in Another Top Blog Rank April 24, 2023
Project Tracking Dashboard March 25, 2023
Excel Unique Formula September 17, 2022
Horizontal Range to Vertical Range in Excel June 15, 2022
Hiding Rows Quickly with VBA May 20, 2022