Time Stamp adjacents cells based off drop down box

NRGben

New Member
Joined
Mar 18, 2015
Messages
2
Good morning,

I am currently trying to have timestamps entered into adjacent cells based off the value selected from a drop down box.

The drop down box values are: Complete (Company), SME Review, and SME Action
These values are in column A, under a title Status in A1.

When Complete (Company) is selected (A) I would like the time stamp to be entered in B in the corresponding column.
When SME Review is selected (A) I would like the time stamp to be entered in C in the corresponding column.
When SME Action is selected (A) I would like the time stamp to be entered in D in the corresponding column.

I have read a lot of the other VBA codes but none were really able to help me out.

Any assistance would be appreciated.

Thanks,
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Good morning,

I am currently trying to have timestamps entered into adjacent cells based off the value selected from a drop down box.

The drop down box values are: Complete (Company), SME Review, and SME Action
These values are in column A, under a title Status in A1.

When Complete (Company) is selected (A) I would like the time stamp to be entered in B in the corresponding column.
When SME Review is selected (A) I would like the time stamp to be entered in C in the corresponding column.
When SME Action is selected (A) I would like the time stamp to be entered in D in the corresponding column.

I have read a lot of the other VBA codes but none were really able to help me out.

Any assistance would be appreciated.

Thanks,
Hi NRGben, welcome to the boards.

Try out the following Worksheet_Change macro in a COPY of your workbook. This code is applied directly to the back end of the sheet in question instead of a standard module. To do this simply right-click on the desired tab name and select View Code. In the new window that opens just copy and paste in the code. Remember to save the document as a macro enabled workbook (.xlsm format) when you are done.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
    If Not Intersect(Target, Range("A2:A" & LastRow)) Is Nothing Then
        Select Case Target.Value
            Case "Complete (Company)"
                Target.Offset(0, 1).Value = Now()
                    Range(Target.Offset(0, 2), Target.Offset(0, 3)).ClearContents
            Case "SME Review"
                Target.Offset(0, 2).Value = Now()
                    Target.Offset(0, 1).ClearContents
                    Target.Offset(0, 3).ClearContents
            Case "SME Action"
                Target.Offset(0, 3).Value = Now()
                    Range(Target.Offset(0, 1), Target.Offset(0, 2)).ClearContents
        End Select
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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