98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » Code for hiding blank columns
Code for hiding blank columns
Resolved · Urgent Priority · Version 2007
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
Tue 25 Jan 2011: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Display Text In a Msgbox On Multiple LinesWhen displaying text in a MsgBox you may need to show it over multiple lines. To do this use: |