Disable Macro

  • Thread starter Thread starter phuser
  • Start date Start date
P

phuser

I have a macro that prompts the user to make a new workbook on startup,
would it be possible to stop the macro using an if statement that says if
this book has any other filename other than the origanl =vbno ?
 
I think what you want is quite straight-forward. In your existing macro you
need to add something like the following before it gets down to business...

if not activeworkbook.name = "blahblahblah.xls" then
exit sub
end if

where blahblahblah.xls is the only workbook where the macro isn't stopped.
 
Sweet!! Thanks so much


Sam Wilson said:
I think what you want is quite straight-forward. In your existing macro you
need to add something like the following before it gets down to
business...

if not activeworkbook.name = "blahblahblah.xls" then
exit sub
end if

where blahblahblah.xls is the only workbook where the macro isn't stopped.
 

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

Back
Top