Enter Current Date in Cell Based on Value of another Cell

bpolkusm

New Member
Joined
Nov 20, 2017
Messages
14
Hi,

I have a sheet Named Master. in Column AC I have a drop down in Rows AC2-AC2195 with Values Yes and No. I am looking for away that when Yes or No is chosen in column AC2-AC2195 the current date is put in Column AD2-AD2195.

Example Cell AC2 has Value of Yes it the date of today 1.27.18 would populate in AD2. and this would work all the way down the columns. AC and AD
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
This script applies to the entire column "AC"
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 29 And Target.Value <> "" And Target.Value = "Yes" Or Target.Value = "No" Then
Target.Offset(0, 1).Value = Date
End If
End Sub
 
Upvote 0
Good Afternoon,

Thank you for the response the the code. The code only seems to be working on the No is selected and not the Yes.

Column AC AD
User Approval Date Approved
Yes
No 1/27/2018


Thanks again on the help with this.
 
Upvote 0
What does this mean?

User Approval Date Approved
Yes


You earlier said "Yes"

Are you now saying it will say:

"User Approval Date Approved Yes"
<strike>
</strike>
 
Upvote 0
Hi,

When I choose Yes from the drop down in Column AC I would like the Date that Yes was chosen populated in AD.

Currently the Marco formula puts the date in if No is Chosen.

Thanks.
 
Upvote 0
The term "Yes" or "No" must be manually entered not entered as a result of a formula change.


I test all my scripts and have tested this several times.

If you enter "Yes" or "No" into column "AC" todays date will be entered into column "AD" same row.

Now you must enter "Yes" not "YES"

If this does not work for you then maybe you have other scripting in your sheet which conflicts with this script.

And you must enter only "Yes"

Not:

"Yes I want to go to the party"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,879
Messages
6,181,530
Members
453,053
Latest member
DavidKele

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