#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro

Hi All
I have a large financial spreadsheet that is sent to me
from another source. I have written a macro to remove all
unwanted data and make a summarized printout. However,
each month the spreadsheet gets one column wider due to
the extra month. How can I rewrite my macro so that it
hides this extra month when it runs. eg, My macro hides
columns C to G, next month it will have to hide C to H,
etc, etc.
Hope you can help
Regards
Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Macro

Michael,

Try something like


Range(Range("A1"), Cells(1, Columns.Count).End(xlToLeft)(1, 0)) _
.EntireColumn.Hidden = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Michael" wrote in message
...
Hi All
I have a large financial spreadsheet that is sent to me
from another source. I have written a macro to remove all
unwanted data and make a summarized printout. However,
each month the spreadsheet gets one column wider due to
the extra month. How can I rewrite my macro so that it
hides this extra month when it runs. eg, My macro hides
columns C to G, next month it will have to hide C to H,
etc, etc.
Hope you can help
Regards
Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro

Thanks Chip
Can you explain how this function works.
I am not aware of some of these commands
The extra column each month will always be the second last column, if
that makes any difference.
Regards
Michael



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 01:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"