Toggle Button
On Jul 30, 5:31*pm, ranswrt wrote:
I have 5 togglebutton controls on a worksheet. *When they are toggled on a
range of cells are highlighted and unlocked. *When they are toggled off the
range of cell are unhighlited and locked is turned on. *The problem I have is
the toggle button can be toggled off before the enter key has been pressed
when making changes to the cell. *Is there a way to disable the toggle button
when data is started to be typed into a cell until the enter key is pressed
or another cell is selected?
Thanks
Right click the sheet you are working in and go to view code... enter
the following...
'=================================================
' The code below will invoke a macro to run when someone clicks a cell
so in this case you can have it disable that toggle button...
'=================================================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ToggleButton1.Enabled = False
End Sub
'=================================================
' The code below will invoke a macro after someone finished entering
data into a cell...
'=================================================
Private Sub Worksheet_Calculate()
ToggleButton1.Enabled = True
End Sub
'---------------------------------------- You could also try this
below for a similar effect (not sure what)
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
|