View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default If Worbook Name = "X" then Prevent Macro From Running

Hi Steve

Try this

Sub test()
If ThisWorkbook.Name < "X" Then
' your code
Else
MsgBox "Save File as Different Name Before Running Macro"
End If
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"SteveC" wrote in message ...
Hi, I have a few macros that need to be run, but only after the user saves
the file as a different name.

Any suggestions that would to add a VBA snippet to a macro that would
prevent it to run if the current workbook name is "X"?

If not too much additional trouble, could I add a pop-up box that states
"Save File as Different Name Before Running Macro." ?

Thanks very much... SteveC