Hourly Refresh

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Checkout OnTime in VBA help. It would be easy to run sometihing every hour
to do an Application.Calculate.
 
Sandy

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


SysAccountant
 
Hi Gary
Thanks for the reply. I had looked at that but I am not sure how to get it
to run at the top of the hour rather than now + 60 mins.
Thanks again

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

SysAccountant said:
Sandy

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


SysAccountant
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top