Disable macro if sheet exist

C

Charles Reid

hello all,

is it possible to disable a macro in excel if a sheet exist.

I have a macro that creates several sheets. I would like to disable that
macro once the sheets are created. Is that possible. I am asking because I
mistakenly ran that macro again and it created more sheets.

Thanks in advance
 
J

Jim Cone

At the beginning of your current macro, something like ...
If Worksheets.Count < 6 then
'create sheets
Else
Exit Sub
End if
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Charles Reid"
wrote in message
hello all,

is it possible to disable a macro in excel if a sheet exist.
I have a macro that creates several sheets. I would like to disable that
macro once the sheets are created. Is that possible. I am asking because I
mistakenly ran that macro again and it created more sheets.

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top