Thread: Hourly Refresh
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SysAccountant SysAccountant is offline
external usenet poster
 
Posts: 17
Default Hourly Refresh

Sandy

I have just written a VBA routine which looks as if it answers your question.

Assuming that you have the nos 1 - 24 in cells A1:A24 ,use the following code:

Sub ConditionalTag()


Dim c As Variant
Dim rng As Range


Set rng = Range("A1:A24")


For Each c In rng


If c.Value = Hour(Now) Then


Call Conditional_Test ' (place the macro/VBA code that you want to
run on the hour)

Else

MsgBox "Unsucessful - try again" ' (place code to handle
unsucessful events ,or leave blank)

End If


Next c


End Sub



Sub Conditional_Test()



MsgBox "Test sucessfull"


End Sub


"Sandy" wrote:

Cell A1:A24 = 1-24 CF Cell value = HOUR(NOW())

"SysAccountant" wrote:

Sandy

When you say "tied to the hour" ; how did you achieve this.


SysAccountant

"Sandy" wrote:

Hi
I have conditional formatting tied to the current hour. The spreadsheet may
not be updated evry hour. How can I refresh/recalc at the top of the hour so
that the conditional formatting changes?
Thanks