Olá pessoal,
A quem interessar, eu encontrei uma solução:
Sub OCULTAJANSED()
Dim xChkBox As CheckBox
Application.ScreenUpdating = False
For Each myCell In Sheets("JANSED").Range("D18:D45")
If myCell = "" Then
myCell.EntireRow.Hidden = True
End If
Next myCell
For Each Chk In ActiveSheet.CheckBoxes
If Not Intersect(Chk.TopLeftCell, Range("18:45")) Is Nothing Then
With Chk
.Visible = Not .Visible
End With
End If
Next Chk
Application.ScreenUpdating = True
End Sub
Sub REEXIBEEJANSED()
Application.ScreenUpdating = False
For Each myCell In Sheets("JANSED").Range("D18:D45")
If myCell = "" Then
myCell.EntireRow.Hidden = False
End If
Next myCell
For Each Chk In ActiveSheet.CheckBoxes
If Not Intersect(Chk.TopLeftCell, Range("18:45")) Is Nothing Then
With Chk
.Visible = Not xHide
End With
End If
Next Chk
Application.ScreenUpdating = True
End Sub
Sub OCULTAPAG1()
Application.ScreenUpdating = False
Set pagina1 = Range("2:55"): Set pagina2 = Range("56:109")
pagina1.EntireRow.Hidden = True: pagina2.EntireRow.Hidden = False
For Each Chk In ActiveSheet.CheckBoxes
If Not Intersect(Chk.TopLeftCell, Range("2:55")) Is Nothing Then
With Chk
.Visible = Not .Visible
End With
ElseIf Not Intersect(Chk.TopLeftCell, Range("56:109")) Is Nothing Then
With Chk
.Visible = Not xHide
End With
End If
Next Chk
Application.ScreenUpdating = True
End Sub
Em todos os casos as checkboxes são ocultadas e reexibidas num range específico.
Postado : 09/09/2018 11:07 am