lock button after click

C

Carl

Hi Guys Dolls

I have a worksheet which is used for master data input - there is a Button
which when clicked generates a "Form" number via a Macro assigned to the
button. After generating the number I want to lock the button. I cannot use
Sheet Protect as I use it at the end of the worksheet when the last user
completes their input the Sheet protection is called via a Macro assigned to
a different button. the button is in Cell I5.

please could you assit with VBA code which would lock the Button after
number generation but leave the rest of the sheet unprotected for data entry.

Many thanks

Carl
 
J

Jacob Skaria

Use the Enabled property...as below after the macro is called

Private Sub CommandButton1_Click()
Run "Macro"
CommandButton1.Enabled = False
End Sub

If this post helps click Yes
 

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

Top