Populating a New Static Date When a Drop Down List is Changed

ahthomas

New Member
Joined
Jan 5, 2023
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I am trying to track some testing specimens at work, and I would like to have to automatically populate a date when the status drop down menu is changed. For example, I have a status column located in column G. The status has a drop down menu including Not Received, Specimens Received, Machining, QC&Dim, NDI, Conformity, Drying, Conditioning, Instrumentation, and Testing. I would like the column next to this status column, so column H to populate the date that the status drop down menu is changed. I have been trying to use some other codes, but nothing seems to be working. Any help would be greatly appreciated.
1672949952175.png
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Welcome to the MrExcel board!

Try this Worksheet_Change event code. To implement ..
1. Right click the sheet name tab and choose "View Code".
2. Copy and Paste the code below into the main right hand pane that opens at step 1.
3. Close the Visual Basic window & test.
4. Your workbook will need to be saved as a macro-enabled workbook (*.xlsm).

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim Changed As Range, c As Range
  
  Set Changed = Intersect(Target, Columns("G"), Rows("2:" & Rows.Count))
  If Not Changed Is Nothing Then
    Application.EnableEvents = False
    For Each c In Changed
      c.Offset(, 1).Value = Date
    Next c
    Application.EnableEvents = True
  End If
End Sub
 
Upvote 0
Solution
This worked incredibly well. Thank you!

Is there a way to add the time to this as well so it is also a date and a time?
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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