ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I program a cell to automaticinput the current date as dat. (https://www.excelbanter.com/excel-worksheet-functions/5975-how-do-i-program-cell-automaticinput-current-date-dat.html)

ces

How do I program a cell to automaticinput the current date as dat.
 
I want to program excel to automatically input the "static date" as I input
text characters in another cell. I've been able to achieve that already in a
similar fashion, however, I don't want the date to change everytime I open
the excel file. Once the date has been entered, I'd like for it to be simple
text and not linked to the computer's time and date stamp. Anyone ever tried
this before?

Jason Morin

You would need a Worksheet_Change event. For example, the
code below inputs the the current time into column B when
text is entered into the adjacent cell in col. A:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column 1 Then Exit Sub
If Target.Count 1 Then Exit Sub
Application.ScreenUpdating = False
With Target.Offset(, 1)
.Value = Format(Now, "mm/dd/yy")
Application.ScreenUpdating = True
End With
End Sub
-----

Right-click on the worksheet tab, View Code, and paste
this into the window.

HTH
Jason
Atlanta, GA

-----Original Message-----
I want to program excel to automatically input

the "static date" as I input
text characters in another cell. I've been able to

achieve that already in a
similar fashion, however, I don't want the date to

change everytime I open
the excel file. Once the date has been entered, I'd

like for it to be simple
text and not linked to the computer's time and date

stamp. Anyone ever tried
this before?
.



All times are GMT +1. The time now is 04:08 PM.

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