Hello
I would like to be able to Unhide columns that have been hidden by a different macro one at a time.
I have a sheet that has dates at the top of each column starting at column H (Jan 08) this can theoretically go all the way to Column IV. I already have some code that hides any column with a date older than 3 months. Eg Today is August 08 so all columns from Jan 08 to May 08 hide. As it hides a column, it adds a column to the end so I have 4 years of dates on show at any one time. I don't think this code its self is important at this time so I have not posted it.
There has come the need to review old information in the hidden columns so I wrote this code that is executed on a command button to unhide the hidden columns.
It doesn't really get any simpler than that. The command button just calls this macro as I have several buttons all doing the same thing on different sheets. The x being written to the cell is so I can stop the hide column macro firing until the workbook is closed.
Instead of unhiding all the hidden columns I would just like to unhide 1 at a time starting with the closest month in time and moving back at each press of the Command Button. This is because as time goes by more and more columns will be hidden and this seems a logical way to mange how many columns are showing.
Thanks as usual for any advise and help recieved.
Partjob
I would like to be able to Unhide columns that have been hidden by a different macro one at a time.
I have a sheet that has dates at the top of each column starting at column H (Jan 08) this can theoretically go all the way to Column IV. I already have some code that hides any column with a date older than 3 months. Eg Today is August 08 so all columns from Jan 08 to May 08 hide. As it hides a column, it adds a column to the end so I have 4 years of dates on show at any one time. I don't think this code its self is important at this time so I have not posted it.
There has come the need to review old information in the hidden columns so I wrote this code that is executed on a command button to unhide the hidden columns.
Code:
Public Sub StopHideCol()
Sheet2.Cells(61, 6) = "x"
ActiveSheet.Columns("G:IV").Hidden = False
End Sub
Instead of unhiding all the hidden columns I would just like to unhide 1 at a time starting with the closest month in time and moving back at each press of the Command Button. This is because as time goes by more and more columns will be hidden and this seems a logical way to mange how many columns are showing.
Thanks as usual for any advise and help recieved.
Partjob