Can I select hiding a column as a conditional formatting?

T

Teresa

I would like to set a conditional formatting that hides the first column of
my spreadsheet when a certain date expires. In addition I would like to add
another column in the back off all others at the same condition.
 
E

Earl Kiosterud

Teresa,

The closest you could come using Conditional Formatting to hide stuff would
be to turn it white (the column would look empty) (I know, it's a crummy
solution). Conditional Formatting won't hide columns. An event-fired macro
could do it.
 
T

Teresa

Turning it white won't work. Can you tell me where to find advice on how to
do such an event-fired macro??
 
E

Earl Kiosterud

Teresa,

You'll have to learn how to put macros in. Take a look at
http://www.mvps.org/dmcritchie/excel/getstarted.htm. Here's a sub that'll
probably do what you want. Put it in the relevant sheet module, not a
general module. You can paste it from here:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("KeyDate")) Is Nothing Then
If Range("KeyDate").Value >= Now() Then
Cells(1, 1).EntireColumn.Hidden = False
Else
Cells(1, 1).EntireColumn.Hidden = True
End If
End If
End Sub

I'm not sure what "another column in the back off all others" means. It
doesn't do that part.
 
Top