Hello - I have a simple macro that looks at a named range which is one row of the spreadsheet from columns 1 to 100. If an "x" is found, that column should be hidden. This code executes extremely slowly. I am evaluating a range with 100 columns but I could do this faster manually. Is there a way to speed this up? Thanks!!!
'Hide Columns with an X
For Each HideRange In Me.Range("HideRange")
If HideRange = "x" Then
HideRange.Columns.Hidden = True
End If
Next
I also tried this another way with the same speed issue....
For Each HideRange In Me.Range("HideRange")
If HideRange = "x" Then
hc = HideRange.Column
Columns(hc).Hidden = True
End If
Next
'Hide Columns with an X
For Each HideRange In Me.Range("HideRange")
If HideRange = "x" Then
HideRange.Columns.Hidden = True
End If
Next
I also tried this another way with the same speed issue....
For Each HideRange In Me.Range("HideRange")
If HideRange = "x" Then
hc = HideRange.Column
Columns(hc).Hidden = True
End If
Next