Ok, I have searched the forum, tried using Excel Help but just can't quite figure it out. What I have created is a project management timeline spreadsheet. what i want to do is use a toggle button to hide and unhide any rows that do not contain any information in column A. sometimes not all the rows will be used this depends on the amount of task for the project.
The following is what I have so far but just cant figure out the rest. If I click more than once ALL rows are hidden.
Private Sub ToggleButton1_Click()
Dim myRg As Range
'Change the [A1], [A65536] to your range
Set myRg = Range([A1].End(xlDown), [A80].End(xlUp))
On Error Resume Next
Set myRg = myRg.SpecialCells(4)
If Err = 0 Then
myRg.EntireRow.Hidden = True
Else
MsgBox "No blanks"
End If
Set myRg = Nothing
End Sub
Additionally, once I have this toggle working I would like to be able to protect the sheet and have the toggle still work.
Any ideas?
Thanks
The following is what I have so far but just cant figure out the rest. If I click more than once ALL rows are hidden.
Private Sub ToggleButton1_Click()
Dim myRg As Range
'Change the [A1], [A65536] to your range
Set myRg = Range([A1].End(xlDown), [A80].End(xlUp))
On Error Resume Next
Set myRg = myRg.SpecialCells(4)
If Err = 0 Then
myRg.EntireRow.Hidden = True
Else
MsgBox "No blanks"
End If
Set myRg = Nothing
End Sub
Additionally, once I have this toggle working I would like to be able to protect the sheet and have the toggle still work.
Any ideas?
Thanks