
Originally Posted by
papastyle3
I've been scrathching my head over this, but for the gurus, this is probably simple.
I've got a weekly file that I update. There are two summary columns that are all the way to the right of the Excel worksheet, and they are the last two columns that an Excel sheet can hold (Columns IU and IV, I believe) . I unhide all available data and hide any columns which have not yet populated data that are blank.
For example, this week I uploaded data into Column C. I need to have Columns D:IT hidden, and leave the last two summary Columns exposed.
I have not been succesful automating hiding and unhiding the columns, since every week the range of columns that I need to select to hide/unhide will change. Does any one have advice on how I should accomplish this?
If I haven't explained this well. let me know.
Thank you experts!
Hi,
One solution is to use the following VBA code:
This will allow you to choose whether to hide or unhide columns. Note that it checks rows 1:100 in clumns A:IV. Change the rows if appropriate.
One suggestion. Why have a total column as the last column. I always find it's better to have a total column as the first column, and indeed a total row as the first row. This means that they always stay in the same position irrespective of how much data you have. If you do this you could no doubt save a bit of time by only checking say columns A:Z in the macro.
HTH
Bookmarks