mardi 17 mars 2015

Run macro (Private Sub) when checkbox is checked

I've got the following macro to select the entire row when the active cell is selected. That's working perfectly! However, I just want to make this macro working when a checkbox is "checked"



Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column <> 1 Then
Exit Sub
Else
Application.ScreenUpdating = False
Cells.Borders.LineStyle = xlLineStyleNone
Rows(Target.Row).BorderAround Weight:=xlMedium, ColorIndex:=3
Application.ScreenUpdating = True

End If

End Sub




Aucun commentaire:

Enregistrer un commentaire