How do I program a cell to automaticinput the current date as dat.

C

ces

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?
 
J

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
 

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

Top