Hello,
Looking for some help on a macro I am trying to use to hide/unhide cells in excel worksheet. I am having two issues,
1. For multiple rows, say ~20, the macro is slow and choppy
2. For rows, I would like to hide from bottom to top
3. For columns, I would like to hide from right to left
The two are below, with the hide versions basically just reversing True/False. Thanks for any help or tips that can be provided!
Sub UnhideACol()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("J6:DY74")
For i = 4 To 1 Step -1
For Each c In HiddenRange
If c.EntireColumn.Hidden = True Then
c.EntireColumn.Hidden = False
Exit For
End If
Next c
Next i
End Sub
Sub UnhideARowl()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("A26:K625")
For i = 20 To 1 Step -1
For Each c In HiddenRange
If c.EntireRow.Hidden = True Then
c.EntireRow.Hidden = False
Exit For
End If
Next c
Next i
End Sub
Looking for some help on a macro I am trying to use to hide/unhide cells in excel worksheet. I am having two issues,
1. For multiple rows, say ~20, the macro is slow and choppy
2. For rows, I would like to hide from bottom to top
3. For columns, I would like to hide from right to left
The two are below, with the hide versions basically just reversing True/False. Thanks for any help or tips that can be provided!
Sub UnhideACol()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("J6:DY74")
For i = 4 To 1 Step -1
For Each c In HiddenRange
If c.EntireColumn.Hidden = True Then
c.EntireColumn.Hidden = False
Exit For
End If
Next c
Next i
End Sub
Sub UnhideARowl()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("A26:K625")
For i = 20 To 1 Step -1
For Each c In HiddenRange
If c.EntireRow.Hidden = True Then
c.EntireRow.Hidden = False
Exit For
End If
Next c
Next i
End Sub