Re: Deselecting - VBA

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Public Sub ARM()
'
'Entry into this routine is by button depression. Each *** has a button
controling the single cell
'
'
If Sheets("Param").Range("S30") = "Off" Then
Sheets("Param").Range("S30") = "On"
Active***.Shapes("Button 1").Select
With Selection.Characters(Start:=1, Length:=8).Font
.ColorIndex = 3 ' Red Font indicates that the "Cell
Selection Change" is arm'ed
End With
Else
Sheets("Param").Range("S30") = "Off"
Active***.Shapes("Button 1").Select
With Selection.Characters(Start:=1, Length:=8).Font
.ColorIndex = 21 ' Green indicates that "Cell Selection Change"
is off.
End With
End If
End Sub

"Jim Thomlinson" <James_Thomlinson@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A159F28B-975C-4337-89E6-40730C384C87@xxxxxxxxxxxxxxxx
Post your code...
--
HTH...

Jim Thomlinson


"C Brandt" wrote:

In a vba routine I have selected a "button" to change the color of the
Font
as an indication of whether the button is in one mode or another. When
the
routine is complete the button remains selected and therefore whenever I
depress it, it thinks I am in edit mode and doesn't function as a
button.

How do I "deselect" the button within VBA prior to leaving the routine
without selecting something else in the ***.

Thanks for any assistance,

Craig





.


Quantcast