fabianolordelo
28-08-2014 20:20:22
Boa tarde,
Tenho o seguinte código que seleciona toda linha da planilha:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
y = Selection.Column
x = Selection.Row
If Selection.Rows.Count + Selection.Columns.Count > 2 Then
Exit Sub
Else
Selection.EntireRow.Select
Cells(x, y).Activate
End If
End Sub
Agora gostaria que esse código funcionasse somente enquanto eu estiver com um botão "ToggleButton" pressionado. E voltasse ao normal quando ele não estiver pressionado. Algum pode me ajudar ?
Tenho o seguinte código que seleciona toda linha da planilha:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
y = Selection.Column
x = Selection.Row
If Selection.Rows.Count + Selection.Columns.Count > 2 Then
Exit Sub
Else
Selection.EntireRow.Select
Cells(x, y).Activate
End If
End Sub
Agora gostaria que esse código funcionasse somente enquanto eu estiver com um botão "ToggleButton" pressionado. E voltasse ao normal quando ele não estiver pressionado. Algum pode me ajudar ?