ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hourly Refresh (https://www.excelbanter.com/excel-programming/395893-hourly-refresh.html)

Sandy

Hourly Refresh
 
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

Gary''s Student

Hourly Refresh
 
Checkout OnTime in VBA help. It would be easy to run sometihing every hour
to do an Application.Calculate.
--
Gary''s Student - gsnu200738


"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


SysAccountant

Hourly Refresh
 
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


Sandy

Hourly Refresh
 
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

"Gary''s Student" wrote:

Checkout OnTime in VBA help. It would be easy to run sometihing every hour
to do an Application.Calculate.
--
Gary''s Student - gsnu200738


"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


Sandy

Hourly Refresh
 
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


SysAccountant

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



All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com