Today's Date function

milesorru

Board Regular
Joined
Nov 3, 2011
Messages
133
Hi

I hope you can help me.

I am trying to find a way of automatically populating a cell using the today (=TODAY ()) function. I have created some drop down boxes and when I select a new field in the drop down box, I want today's date to enter in the next cell. ie "Awaiting Delivery" to "Received"

Is this possible?

I would really appreciate your help

Miles
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Miles:

Not sure I have the whole picture. If cell A2 is where your drop down it and B2 is where you want your date to appear, when something is selected in A2 then try:

B2 = if(A2="","",Today())

This keeps B2 empty until something is put in A2.

Hope this is on track.

Jeff
 
Upvote 0
Welcome to MrExcel.

Explain what you are after a little more, if you could. So when nothing is in the dropdown box you want the cell to be blank, but you want it to show =today() when there is something (anything?) there?
 
Upvote 0
Miles

If you want some sort of static timestamp then you'll need code.

Using a formula will mean the date/time isn't static and will update every time the worksheet is calculated.
 
Upvote 0
HI

Thanks all for your responses. Jeff, that did the trick although I have adapted it for me. =IF(A9="awaiting-edit",TODAY()," ")

Norie

You are correct in as much as, If the above changed to anything else, the date would disappear.

How can I keep it static so that it will not change. I think I'm asking too much

Many Thanks :)
 
Upvote 0
Like I said, you need code.

It's actually quite simple code.

Right click the tab of the worksheet of interest and select View Code.

The add this code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
     If Target.Address(0,0) = "A9" Then
          Application.EnableEvents = False
          If Target.Value <>"" Then target.Offset(,1) = Now()
     End If
     Application.EnableEvents = True
End Sub
This will take care of A9 but can be expanded for a larger range, the whole worksheet, a specific column/row etc
 
Upvote 0
Hi

Thanks for this. I got exactly what i needed but i am struggling with something else now.

So from the above, I have a column that contains dropdown lists. When any of these is selected, it returns 'today's' date in the next column.

One of the statuses in the dropdown list is "TX-Ready". How can I get 'today's' date entered in a seperate column when this status is changed to TX-Ready.

What would the code be for this?

I would really appreciate your help

Many Thanks

Miles
 
Upvote 0

Forum statistics

Threads
1,222,313
Messages
6,165,293
Members
451,950
Latest member
WH2000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top