Colin Hayes presented the following explanation :
In article , GS writes
You're very welcome! Glad you were able to sort it out. Next time..,
I'll be less presumptuous!<g
Hi Garry
Just out of interest , how would you add a colour (say Green) to the word
'Open' in the Function code? I toyed with it but could find no successful
way. There seem to be many codes for colour implementation in VBA, but none
that work...
Function Get_ShopOpenStatus(CurrentTime As Variant) As String
Dim vShopOpens, vShopCloses
vShopOpens = TimeValue("8:00 AM")
vShopCloses = TimeValue("4:30 PM")
If TimeValue(Now) vShopOpens And TimeValue(Now) < vShopCloses Then _
Get_ShopOpenStatus = "open." Else Get_ShopOpenStatus = "closed."
End Function
Thanks Garry.
Well, I think you're gonna have to look at getting involved with
multiple properties and lots of character manipulation. I've never had
any need to do this programmatically so try doing it manually with the
macro recorder and see what, if any, code generates.
You might be better off just setting the cell's font to green for times
that fall into open hours.
--
Garry
Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc