Update cell date

fady77

New Member
Joined
Dec 3, 2017
Messages
10
Dear All
I have a data table where the colmns from A to H are one time data entry the others will be updated occasionaly
and also the table will have additional rows
if you could please help me to if any of the remaining colums have any updated data i would have the date in the column Q to be recorded as the date of the updating data
the problem i am facing is that the columns are located on the left and right of the column Q
i tried this code but it always make the file close and crash
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Row < 7 Then Exit Sub
If Target.Column < 8 Then Exit Sub
Cells(Target.Row, "Q") = Date
End Sub


thank you in advance for your help
 

Attachments

  • Untitled captured.png
    Untitled captured.png
    142.9 KB · Views: 7

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Try this:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Cells.Count > 1 Then Exit Sub
  If Target.Row < 7 Then Exit Sub
  If Target.Column < 8 Then Exit Sub
  Application.EnableEvents = False
  Cells(Target.Row, "Q") = Date
  Application.EnableEvents = True
End Sub
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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