how to put date for each row?

ULFAH LINA

New Member
Joined
Sep 30, 2021
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
hi and thanks in advance,

I want a date for a specific row

I have the code. I'm using

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 7 Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
With Target.Offset(0, 2)
.Value = Now
.NumberFormat = "DD/MM/YYYY hh:mm AM/PM"
End With
End Sub


it worked so well ONLY if I update this particular workbook

in column 7 I linked to another workbook (not in the same workbook for this code)

so usually when I update in other files, the number will correspond with this particular workbook, in column 7

but the date n time stamp for - With Target.Offset(0, 2) - code is not working. only works if I update this workbook myself but I don't want that.

please help me thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I think the worksheet event will not trigger if changed by formula. Try use worksheet calculate event.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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