ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Hide Colums (https://www.excelbanter.com/excel-programming/355409-macro-hide-colums.html)

keen learner

Macro to Hide Colums
 
Hi There fellow community member

Please Help

I HAVE A SPREADSHEET WITH ROW AND COLUMN HEADERS WHICH IS UPDATED EVERY
MONTH. i NEED TO CREATE A MACRO THAT WILL HIDE AND UNHIDE COLUMNS TO ENABLE
ME TO VIEW 6 AND 12 MONTHS DATA ALTERNATIVELY.

What I need for the macro to do is the following
1) Go to row 6 (where my data starts)
2)from row 6 search and identify by column the last column that contains
data(as every month i add a new column.
3)Offset the last column(iLastCol) by 6
4)Hide columns from column b to iLastCol-6 (Column A contains the Row headers)

Bob Phillips[_6_]

Macro to Hide Colums
 
Don't open another thread, the other is still active.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"keen learner" wrote in message
...
Hi There fellow community member

Please Help

I HAVE A SPREADSHEET WITH ROW AND COLUMN HEADERS WHICH IS UPDATED EVERY
MONTH. i NEED TO CREATE A MACRO THAT WILL HIDE AND UNHIDE COLUMNS TO

ENABLE
ME TO VIEW 6 AND 12 MONTHS DATA ALTERNATIVELY.

What I need for the macro to do is the following
1) Go to row 6 (where my data starts)
2)from row 6 search and identify by column the last column that contains
data(as every month i add a new column.
3)Offset the last column(iLastCol) by 6
4)Hide columns from column b to iLastCol-6 (Column A contains the Row

headers)



davesexcel[_45_]

Macro to Hide Colums
 

I was doing a very quick search and found nothing, but as I read you
thread I was thinking about "joining" groups
Highlite the columns you want to hide and goto
Data=Group and Outline=and select group
Now there will be a "-" sign above your columns click on the minus sig
and the group will hide, there are also numbers at the side of th
column you can click to hide columns, this also works for rows,
you can have many grouped columns and rows.

If you don't like using the groups method, you can always try you
macro recorder , like end,= takes you to the last cell with data in
row ...

--
davesexce
-----------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3170
View this thread: http://www.excelforum.com/showthread.php?threadid=52004



All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com