View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Conditional Column Hide

Dim cell as Range
for each cell in Range("A3:IV3")
if not isempty(cell) then
if isdate(cell.value) then
if cell.Value < Date then
cell.EntireColumn.Hidden = True
else
cell.EntireColumn.Hidden = false
end if
end if
end if
Next

or


for each cell in Range("A3:IV3")
if not isempty(cell) then
if isdate(cell.value) then
cell.EntireColumn.Hidden = cellValue < Date
end if
end if
Next

--
Regards,
Tom Ogilvy


"firebird96" wrote in message
...

I want to hide each column that meets a certain condition. ie. I want to
hide column 'B' if B3 < Today() or I want to hide column 'C' if C3 <
Today(), an so on down the line. Yes, I want to hide each column where
the date in row 3 is less than todays date.

Kevin


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements