Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Colin Hayes explained on 6/30/2011 :
In article , GS writes Try... .Range("A21").Value = "Last Updated: " _ & Format(Now, " dddd dd/mm/yy at hh:mm:ss") _ & ", when the shop was " & Get_ShopOpenStatus(TimeValue(Now)) 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 HI Garry OK thanks for getting but so expertly. I'm getting an 'Expected End Sub' error just before the line Function Get_ShopOpenStatus(CurrentTime As Variant) As String I'm placing your code in a Private Sub context under the tab on the sheet. I wonder if this is causing the issue. Thanks again for your help. Colin, The line of code is a revised version of the snippet of code you provided in your original post. Just replace your original line with mine...! -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How would you include an existing logo in a worksheet? | Excel Discussion (Misc queries) | |||
Formatting worksheets, existing and new, in existing workbooks | Excel Discussion (Misc queries) | |||
download existing spreadsheets into another existing spreadsheet | Excel Discussion (Misc queries) | |||
Extending Row() | Excel Worksheet Functions | |||
Can inserted rows automatically include existing worksheet formula | Excel Discussion (Misc queries) |