Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable buttons in excel

Status
Not open for further replies.

olatzcelaya

Programmer
Jan 4, 2008
13
GB
Hi all,

I am programming in the VBA of excel and I want to disable some buttons and cells in the excel sheet regarding the values that I introduce in other cells.Do you know how can I do this???

Thank you,

Olatz
 
How do you mean "disable cells" exactly?

With buttons I believe you change the Enabled property.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
The buttons are easy
btnSave.Enabled = False

To "disable" cells you have to set the Locked property for each cell and then set the sheet to be Protected.

VBA terms to use are Locked, Protect and Unprotect
Range("A1").Locked = True
Sheet1.Protect
Sheet1.Unprotect





Spook :-j
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top