View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default checking for hidden columns

Sorry about the mix up between columns and rows. I cut, pasted, and modified
on the fly.

Columns(iCol).EntireColumn.Hidden


"Charlie" wrote:

I don't think you need a macro to do that, just do:

If Not Columns(iCol).EntireRow.Hidden Then
Columns(iCol).EntireRow.Hidden = True
End If

But even that I quit doing long ago. Except in cases of heavy computation
where it's best to check first if something needs to be done, I've found it's
simpler just to do

Columns(iCol).EntireRow.Hidden = True

and not worry about if it is already hidden. The above statement uses so
little CPU time it's irrelevant whether or not it's already hidden.


"stickandrock" wrote:

I want to create a macro that will validate whether a column is hidden or
not. I can make column hidden and/or unhide columns, but it is redudant if
they are already in the state that I need them.

Thank you for any and all input.