I am working on an analysis spreadsheet which allows for multiple properties to be analysed or for a single property to be analysed and as part of this I have several areas where there is the option to open up additional columns for properties if needed by the user. I have a macro to unhide these columns in order from property 1 to 10, however I am looking for a macro that will allow me to hide these columns from property 10 to 1 (reverse order), but can't seem to get it right. If I reverse my unhide macro it will hide them from 1 to 10, not 10 to 1 so I'm a little stumped how to get the format I want.
Can anyone help with this? My unhide macro is below if of any use for context; Essentially, this one is unhiding the columns from L to FE, but I would like the hide function to go from FE to L
__________________________
Sub UnhideACol()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("L6:FE74")
For i = 5 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
End Sub
Can anyone help with this? My unhide macro is below if of any use for context; Essentially, this one is unhiding the columns from L to FE, but I would like the hide function to go from FE to L
__________________________
Sub UnhideACol()
Dim HiddenRange As Range, c As Range
Dim i As Integer
Set HiddenRange = Range("L6:FE74")
For i = 5 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
End Sub