ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to make the Today() function static (https://www.excelbanter.com/excel-programming/272588-how-make-today-function-static.html)

JC Home

How to make the Today() function static
 
I would like to have a cell enter the current date when I make an entry in
another cell, but I would like it to be static. The today() and now() both
seem to be volatile. I know that I could use cntl ; but I would like it
to be entered automatically.

Thanks

--
Jeff Ciaccio
Dallas, GA
(W) 770-591-6819 x-274
http://mywpages.comcast.net/ciaccio8515



Bob Phillips[_5_]

How to make the Today() function static
 
Jeff,

Apart from mis-spelling your name (sorry!), I forgot to mention that this
code, if you choose to use it, should go into the applicable sheet module.

To get to this, right-click the sheet tab, and select the View option. This
will open the sheet code module, so then paste the code I gave into the code
pane.

Also, if you don't want the time, just use
Target.Offset(0, 1).Value = Format(Date, "dd mmm yyyy")

--

HTH

Bob Phillips

"Bob Phillips" wrote in message
...
Jedff,

VBA okay. This adds the datre to one coluimn right if achange is made to
A1:A10.

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
If Target.Count = 1 Then
Target.Offset(0, 1).Value = Format(Date, "dd mmm yyyy

hh:mm:ss")
End If
End If

ws_exit:
Application.EnableEvents = True

End Sub


--

HTH

Bob Phillips

"JC Home" wrote in message
...
I would like to have a cell enter the current date when I make an entry

in
another cell, but I would like it to be static. The today() and now()

both
seem to be volatile. I know that I could use cntl ; but I would like

it
to be entered automatically.

Thanks

--
Jeff Ciaccio
Dallas, GA
(W) 770-591-6819 x-274
http://mywpages.comcast.net/ciaccio8515







Paul Vespo

How to make the Today() function static
 

-----Original Message-----
I would like to have a cell enter the current date when I

make an entry in
another cell, but I would like it to be static. The

today() and now() both
seem to be volatile. I know that I could use cntl ; but

I would like it
to be entered automatically.

Thanks

--
Jeff Ciaccio
Dallas, GA
(W) 770-591-6819 x-274
http://mywpages.comcast.net/ciaccio8515


Jeff,

I assume you are familiar with the vba environment in
Excel. Go ahead and go into the VBA environment (ALT+F11).
Dbl Click the worksheet you want to do this with. Select
Worksheet in the combo box at the top left. Goto the
Worksheet_Change. Do something like the following:

IF Target.Col=X and Target.Row=Y THEN
Target.offset(0,5)=str(Date) 'go over 5 columns and
place date stemp.
END IF

-Paul

[email protected]

How to make the Today() function static
 
On Thu, 24 Jul 2003 15:38:03 -0400, "JC Home" wrote:

I would like to have a cell enter the current date when I make an entry in
another cell, but I would like it to be static. The today() and now() both
seem to be volatile. I know that I could use cntl ; but I would like it
to be entered automatically.

Thanks


Record a macro where you type =now()into any blank cell, copy,
paste-special/value. Anywhere you want to insert a static date, select that
cell and run the macro. Assigning that mcro to a key combination makes it
really easy to use.


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

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