T
Todd
I have code like the following and it works almost like I
want it so that the cells will highlight in yellow when
you click on the command button however when I check the
checkbox it will activate the Form worksheet I have and
take the user over to that worksheet. I do not want
anything to happen until after the command button is
pressed. What can I add or remove to this code to allow
this to happen?
Thanks!
Option Explicit
Private Sub CommandButton1_Click()
Call CheckBox2_Click
End Sub
Private Sub CheckBox2_Click()
If Me.CheckBox2.Value = False Then Exit Sub
Sheets("Form").Activate
ActiveSheet.Range("Address").Select
If Selection.Interior.Pattern = xlNone Then
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Else
With Selection.Interior
.Pattern = xlNone
End With
End If
End Sub
want it so that the cells will highlight in yellow when
you click on the command button however when I check the
checkbox it will activate the Form worksheet I have and
take the user over to that worksheet. I do not want
anything to happen until after the command button is
pressed. What can I add or remove to this code to allow
this to happen?
Thanks!
Option Explicit
Private Sub CommandButton1_Click()
Call CheckBox2_Click
End Sub
Private Sub CheckBox2_Click()
If Me.CheckBox2.Value = False Then Exit Sub
Sheets("Form").Activate
ActiveSheet.Range("Address").Select
If Selection.Interior.Pattern = xlNone Then
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Else
With Selection.Interior
.Pattern = xlNone
End With
End If
End Sub