Siphiwe has attended:
Excel VBA Intro Intermediate course
Code for hiding blank columns
Good Morning
Can you kindly send me a code to hide specific columns on a worksheet but l want.
l have a total of 108 columns, Jan (Actual,Budget,PY) - Dec (A,B,PY), l want to be able to view the current period/month & to hide the rest ...
Many thanks in anticipation!
RE: Code for hiding blank columns
Hi Siphiwe, thanks for your query. I can't really code this for you without see the source data but your main task will be to loop through the column headings performing an If...End If test to see whether the date falls within the current month. If it isn't then set the .hidden property of that column to true. Have a go and see how you get on.
Hope this helps,
Anthony