ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto populating date field (https://www.excelbanter.com/excel-discussion-misc-queries/94739-auto-populating-date-field.html)

TimM

Auto populating date field
 
Ok so I have the following formula =IF(OR(H1={1,2,3,4}),TODAY(),"") and it
works all well and good but every day it changes the field to the next day.
Is there a way to make it so it will not update the next day.

What it does is when I enter a 1, 2, 3, 4 into that row in column H it
populates the field (we will say A1) with todays date. And it stays blank
when H is empty.

If any one can figure this out for me it would be great. Its not a dire
thing but more of a Ive gone this far with it might as well have it work
properly.

--
Thanks
TimM

CLR

Auto populating date field
 
Maybe with code.........

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("h1").Value <= 5 Then
Range("a1").Value = Date
Else
Range("a1").Value = ""
End If
End Sub


Vaya con Dios,
Chuck, CABGx3



"TimM" wrote:

Ok so I have the following formula =IF(OR(H1={1,2,3,4}),TODAY(),"") and it
works all well and good but every day it changes the field to the next day.
Is there a way to make it so it will not update the next day.

What it does is when I enter a 1, 2, 3, 4 into that row in column H it
populates the field (we will say A1) with todays date. And it stays blank
when H is empty.

If any one can figure this out for me it would be great. Its not a dire
thing but more of a Ive gone this far with it might as well have it work
properly.

--
Thanks
TimM



All times are GMT +1. The time now is 02:19 AM.

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