Disable macro if sheet exist

  • Thread starter Thread starter Charles Reid
  • Start date Start date
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
 
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
 
Back
Top