View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dallman Ross Dallman Ross is offline
external usenet poster
 
Posts: 390
Default Need a macro to hide certain columns

Short version: I want a macro to hide columns of a certain
cell color and font color.

Long version, which includes my reasons:
I have a sheet with lots of complex formulas and found it has
gotten unwieldy and recalculates all the time now and takes way
too long to do so. I have now revised a lot of the formulas
and added various helper columns to reduce the calculations
per cell and, hopefully, get out of my calculation pickle.
(Haven't quite succeed yet in the latter, though, unfortunately.)
I hide all the helper columns. However, to revise the sheet
I'm unhiding all the hidden columns temporarily. I've formatted
these normally-hidden columns all a certain color and also
changed the font color there, so I can easily distinguish these
as columns to hide again. Now I want a macro to do that for me.

Would someone be kind enough to help me with such a macro?

Here's some pseudo-code:

For nextcol in columns 1-30
If {data range} = Hex Val. #CCCCFF
If {data range} font color = #0000FF
Hide column
End If
End If
End of For-Loop


Dankeschoen!

--
Dallman Ross