Conditional Column Hide

  • Thread starter Thread starter firebird96
  • Start date Start date
F

firebird96

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
 
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 said:
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


------------------------------------------------



~~Now Available: Financial Statements.xls, a step by step guide to
creating financial statements
 
Back
Top