View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Gareth[_3_] Gareth[_3_] is offline
external usenet poster
 
Posts: 109
Default Help with some sheet code

Bob

Works great for dates typed in but doesn't work for any dates that are
copied into the I or J, another scenario is that dates are 'shifted' into
the range (Insert | Cells | Shift cells right) It doesn't work when this
happens either.

Any way around this?

"Bob Phillips" wrote in message
...
Gareth,

Are you saying that when you copy something into column I, the colour is
that of the copied data (even if you had previously made I blue)?

I guess that you could try worksheet event code like this

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Target.Column = 9 Or Target.Column = 10 Then
Target.EntireColumn.Font.ColorIndex = 5
End If

ws_exit:
Application.EnableEvents = True
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Gareth" wrote in message
...
Bob

I don't want the font color to change from blue when the date in I or J

has
passed. That is why I thought CF might not be suitable.

Would some kind of sheet event work?

Gareth

"Bob Phillips" wrote in message
...
Gareth,

Conditional formatting can do what you want. But as you say, it will

revert
as time passes (but as it's not greater than today at some point,

isn't
that
appropriate?).

Just use a formula like, =I1TODAY() in CF.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Gareth" wrote in message
...
Columns I and J on my sheet are date columns. I need the font to be

blue
if
the date is greater than today. The dates will be both typed and

copied
in.

Can conditional format be used, or would font colur go back to

normal
as
time passes?

Gareth