VBA Insert Date in End Cell on Worksheet Change

rickincanada

Board Regular
Joined
Aug 31, 2010
Messages
61
I have a workbook which contains a list of vehicle Stock Numbers and then the next 10 columns are websites those vehicles need to be listed on. The 11th (last) column is a date column. What I'm wanting (if it is possible) is to have the date column populate with the current date when the first of the 10 columns is set to Yes (validation is in place to only allow "Yes" or blank). If there is a date there currently I don't want to effect it. Here is a simple example of my workbook:

Stock # | eBay | Kijiji | You Tube | Date

A user will come in and enter a Stock # and then once they select Yes under any of the following columns I want the date to auto-populate into the Date column.

Thanks for any help you can provide!

Rick
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,

Assuming your data in columns A to L (Date); beginning in row 2 and ending in row 1000; and headers in row 1
(adjust accordingly)

Maybe this

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("B2:K1000")) Is Nothing Then
        Application.EnableEvents = False
        If UCase(Target.Value) = "YES" And Cells(Target.Row, "L") = "" Then
            Cells(Target.Row, "L") = Date
        End If
        Application.EnableEvents = True
    End If
End Sub

HTH

M.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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