Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If worksheet name already exists?

Status
Not open for further replies.

eti3nne

MIS
Feb 5, 2004
102
I create a new worksheet based on the currently active sheet's name eg wc08Dec08 plus 28 days gives wc05Jan09 etc.

If the new name already exists, I get a warning message, the macro fails and a new sheet called eg Sheet 1 is created.

How can I write an 'if exists statement' to capture this condition and warn the user that they have tried to create a sheet already available and also to delete the new 'Sheet1'. (NB. This Sheet number may be variable?)

Thanks for looking.
 
Please ask VBA questions in forum707 .

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top