Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
locking and unlocking a textbox using command buttons
I have a userform with a textbox (TextBox1) on it linked to a cell in the
spreadsheet. I have two command buttons on the form : cmdLock and cmdUnlock What I am looking for is for code for the cmd buttons which will lock and unlock the textbox for editting and will also toggle the lock and unlock buttons from being Enabled True or False depending on whether the textbox is locked or not. Can anyone help? Thanks, Roger |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
locking and unlocking a textbox using command buttons
Roger
You may be able to do it with one commandbutton with the following code: Private Sub CommandButton1_Click() TextBox1.Enabled = Not TextBox1.Enabled TextBox1.Locked = Not TextBox1.Locked End Sub You may prefer to buttons if the enabling and locking are not always in synch, but, the two lines in the procedure above should get you started. Good luck Ken On Jan 14, 3:35*pm, Roger on Excel wrote: I have a userform with a textbox (TextBox1) on it linked to a cell in the spreadsheet. I have two command buttons on the form : cmdLock and cmdUnlock What I am looking for is for code for the cmd buttons which will lock and unlock the textbox for editting and will also toggle the lock and unlock buttons from being Enabled True or False depending on whether the textbox is locked or not. Can anyone help? Thanks, Roger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unlocking and Locking in a Marco | Excel Programming | |||
locking and unlocking worksheets | Excel Worksheet Functions | |||
Conditional Cell Locking/Unlocking | Excel Programming | |||
Locking and unlocking a workbook | Excel Programming | |||
Locking/unlocking cells | Excel Programming |