ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   new to date (https://www.excelbanter.com/excel-programming/424880-new-date.html)

Curt

new to date
 
Am trying to when day = x add 123 to cell f3
End result will be every time day =x add 123 to cell f3. This will grow with
each month.
I got day out of cell when date changed f3 now #value
This could be done on close or open of workbook. tried all I can think of.
No luck yet.
Thanks to all for help

Gary''s Student

new to date
 
Run this at least once a day:

Sub updatee()
n = Day(Date)
Set f3 = Range("F3")
Set z100 = Range("Z100")
If n = 1 Then
If z100.Value = Date Then
Else
z100.Value = Date
f3.Value = f3.Value + 123
End If
End If
End Sub

the update is performed on the first of the month and is only performed once
on that day. (uses Z100 to remember the update has already been performed)
--
Gary''s Student - gsnu200835


"Curt" wrote:

Am trying to when day = x add 123 to cell f3
End result will be every time day =x add 123 to cell f3. This will grow with
each month.
I got day out of cell when date changed f3 now #value
This could be done on close or open of workbook. tried all I can think of.
No luck yet.
Thanks to all for help


Curt

new to date
 
I notice your comment "run this at lease once a day" ? Will not z100 keep
all in line if program is not accessed daily. With my limited understanding
this is what it seems. Asking because I am not sure.
For some reason web site did not notify so I only found out by going in to
look some more. Sure do appreciate the help
Thanks

"Gary''s Student" wrote:

Run this at least once a day:

Sub updatee()
n = Day(Date)
Set f3 = Range("F3")
Set z100 = Range("Z100")
If n = 1 Then
If z100.Value = Date Then
Else
z100.Value = Date
f3.Value = f3.Value + 123
End If
End If
End Sub

the update is performed on the first of the month and is only performed once
on that day. (uses Z100 to remember the update has already been performed)
--
Gary''s Student - gsnu200835


"Curt" wrote:

Am trying to when day = x add 123 to cell f3
End result will be every time day =x add 123 to cell f3. This will grow with
each month.
I got day out of cell when date changed f3 now #value
This could be done on close or open of workbook. tried all I can think of.
No luck yet.
Thanks to all for help



All times are GMT +1. The time now is 10:18 AM.

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