Excel // VBA / / Macro // Code needed to set a date in a cell in the contents of another cell changes

Evremonde

New Member
Joined
Sep 29, 2016
Messages
25
Hello All:

I have a spreadsheet and I need some VBA assistance. I think this is easy but we shall see. Cells E2 through E1000 may contain either OP or GS. On initial data entry, the contents of the range will be set to either OP or GS (data entry will start at E2 and proceed to E3, E4, Etc as need). After initial data entry, the contents of the range may be changed from OP to GS - or - from GS to OP. If this occurs, I need to set the date of change in another column on the same row (not sure which column yet). Any VBA code to perform this function would be appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try something like this
1. Right click on the worksheet tab(the worksheet with the data
2. Select "View Code"
3. Paste the following code in there

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("E2:E1000")) Is Nothing Then
        Range("Z" & Target.Row).Value = Time
    End If
End Sub

It updates the date in column Z
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,039
Members
449,063
Latest member
ak94

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