LizCorbert
02-03-2016, 08:21 AM
I have the following code that unhides a column each time the button is selected. The unhiding of columns works fine, however, the order of the columns are reversed. For instance, the columns being unhidden are named "Option 1", "Option 2", "Option 3".................. through "Option 25". My problem is the unhidden columns are brought in before each column instead of after. For instance instead of Option 1, Option 2, Option 3. My code produces Option 3, Option 2, Option 1. Can someone assist me in revising this code, please!
Worksheets("Property").Activate
Dim col AsInteger, CNo AsInteger
For col =1To Columns.Count
If Columns(col).Hidden =TrueThen
CNo = col
EndIf
Next col
If CNo >0Then
Columns(CNo).Hidden =False
EndIf
Worksheets("Property").Activate
Dim col AsInteger, CNo AsInteger
For col =1To Columns.Count
If Columns(col).Hidden =TrueThen
CNo = col
EndIf
Next col
If CNo >0Then
Columns(CNo).Hidden =False
EndIf