ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Alias for =today() (https://www.excelbanter.com/excel-discussion-misc-queries/125772-alias-%3Dtoday.html)

Luke Slotwinski

Alias for =today()
 
I have a column formated for simple date. I'd like to be able to enter "T"
in the cell and have it automatically insert the current date, when leaving
the cell. Essentially replacing "T" with =today(). What would be the most
efficient way of going about this.

Thank you,
Luke Slotwinski

Bongard

Alias for =today()
 
Maybe try to give us the whole vlookup statement, and if you have any
idea what its referencing or pulling that would be helpful too. That
looks like it is supposed to search down the entire sheet, but its hard
without the entire statement or a little more background.


Bernard Liengme

Alias for =today()
 
How about Tools | AutoCorrect
It is case sensitive and leaving the cell using navigation key will not
trigger the change but ENTER and TAB will.
Remember - AutoCorrect applies to ALL MS Office apps not just Excel
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Luke Slotwinski" wrote in
message ...
I have a column formated for simple date. I'd like to be able to enter "T"
in the cell and have it automatically insert the current date, when
leaving
the cell. Essentially replacing "T" with =today(). What would be the most
efficient way of going about this.

Thank you,
Luke Slotwinski




Jim Cone

Alias for =today()
 
You could right-click the sheet tab, select view code and insert the
following code. Change C5 (in the code) to the appropriate cell.
The $ signs are required.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo LeaveSub
Application.EnableEvents = False
If Target.Address = "$C$5" And Target.Value = "T" Then
Target.Value = Date
End If
LeaveSub:
Application.EnableEvents = True
End Sub
'------------


"Luke Slotwinski"

wrote in message
I have a column formated for simple date. I'd like to be able to enter "T"
in the cell and have it automatically insert the current date, when leaving
the cell. Essentially replacing "T" with =today(). What would be the most
efficient way of going about this.

Thank you,
Luke Slotwinski

Dave O

Alias for =today()
 
Another way to do this is to write "on change" code for a certain
column or range of cells. The (VBA) code would direct Excel to replace
a cell with the formula =TODAY() if that cell was changed to T.

Do you want the TODAY() formula, which would change from day to day
because the date changes each day, or do you need a static value in
that cell that indicates the date you entered that T?


RagDyeR

Alias for =today()
 
Couldn't you just use a resident procedure of:
<Ctrl < ; (control semi-colon)

Will return the current date in whatever date format you pre-formatted the
cell (column) to.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Luke Slotwinski" wrote in
message ...
I have a column formated for simple date. I'd like to be able to enter "T"
in the cell and have it automatically insert the current date, when
leaving
the cell. Essentially replacing "T" with =today(). What would be the most
efficient way of going about this.

Thank you,
Luke Slotwinski



Gord Dibben

Alias for =today()
 
Luke

Can be done a couple of different ways.

Do you want the updating function of TODAY() or just have a static date entered?

1. Select range or column and InsertNameDefine.

Name "T"(no quotes)

Refers to =TODAY()

enter =t to get an updating date in the cell.

For a static date just hit CTRL + ;

2. With code you could either a static date or the formula =TODAY()

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1:A100")) Is Nothing Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
If .Value = "T" Then
' .Value = Date 'static date only
.Value = "=TODAY()"
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 11 Jan 2007 12:00:03 -0800, Luke Slotwinski
wrote:

I have a column formated for simple date. I'd like to be able to enter "T"
in the cell and have it automatically insert the current date, when leaving
the cell. Essentially replacing "T" with =today(). What would be the most
efficient way of going about this.

Thank you,
Luke Slotwinski



James Silverton

Alias for =today()
 
Hello, Bernard!
You wrote on Thu, 11 Jan 2007 16:19:50 -0400:

BL How about Tools | AutoCorrect
BL It is case sensitive and leaving the cell using navigation
BL key will not trigger the change but ENTER and TAB will.
BL Remember - AutoCorrect applies to ALL MS Office apps not
BL just Excel best wishes
BL

Now that's a really interesting thing to know! Thanks again!

?? I have a column formated for simple date. I'd like to be
?? able to enter "T" in the cell and have it automatically
?? insert the current date, when leaving the cell.
?? Essentially replacing "T" with =today(). What would be the
?? most efficient way of going about this.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not



All times are GMT +1. The time now is 06:55 AM.

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