Rob
Just set the Enabled property of the button to False at the end of its code. You could also set the Visible property to False - this would mean the user would no longer be able to see the button.
I don't know where the button is, but if it were on a worksheet, the code would be:
Worksheets("Sheet1").CommandButton1.Enabled = False
and/or
Worksheets("Sheet1").CommandButton1.Visible = False
Does this help?
Regards
Yes, the button is on sheet "Application". I tried the code you gave me (Worksheets("Sheet1").CommandButton1.Enabled = False) but it gives an error when i run the macro. (Object doesn't support this property or method). Do I need to name the button or something?
Thanks
Rob
You need to identify the button and the sheet in the code. You could have referred to it as Worksheets("Application") but Me does just as well.
As for the button - you need to identify its name. CommandButton name should be obvious from the Code page for the worksheet (the code page in which you have the code for the button) - just use the same name as appears in the "Click" event name.
Code line may be simply:
Me.CommandButton1.Visible = False '[Substitute whatever the name of the button is for "CommandButton1
If you are not sure, just set it to any of the bottons on the page. If the wrong button disappears, just reverse the procedure to:
Me.CommandButton1.Visible = True
to get it back again. Then try another one.
Does this help?
Regards