View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GBExcel via OfficeKB.com GBExcel via OfficeKB.com is offline
external usenet poster
 
Posts: 26
Default Deactivate button macro if condition not met

Thank you Marcus,

I had to add in an End if, and it works.

If Range("A1").Value = "" Then
'Run your code

Else: MsgBox "Stop! Button may not be used on this page."

Exit Sub
End If

End Sub

--
Message posted via http://www.officekb.com