Macro to Hide Colums

G

Guest

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)
 
B

Bob Phillips

Don't open another thread, the other is still active.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

keen learner said:
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)
 
D

davesexcel

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 ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top