View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Identify Hidden Columns

Steve has brought this to us :
Hi All,

Is there a way to determine which columns are hidden (prior to a macro
execution, and may vary each time the macro is executed), then UNhide
those columns, execute the code, and finally REhide the original
columns that were hidden?

Thanks!


You can do this several ways, but they'd all follow the same concept;

Loop the columns in the range

If col.Hidden Then add its index to a delimited string
OR redim/add to an array

col.Hidden = False

do stuff...

Loop the array or delimited string and...
Columns(<LoopCounter).Hidden = True

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc