Multiple time stamp

Vtookup

Board Regular
Joined
May 30, 2017
Messages
124
Office Version
  1. 2016
  2. 2013
Hi All.
Please check this code for time stamp
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Application.Intersect(Target, Range("C3:C10")) Is Nothing Then
If Target.Count = 1 Then


Range("B" & Target.Row) = Format(Now, " h:mm AMPM;@")


End If
Application.EnableEvents = True
End Sub
this is a working code. I try to use this code in another worksheet but it won't work.
what should be change in the code if i want to use it in another worksheet (same workbook)
planning to add a few page (Sheets) with time stamp feature.
Hope to get help. Thanks.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
It is a worksheet change event that is particular to a certain worksheet. To make it work in another sheet, you will need to copy and paste it into the other worksheet.
 
Upvote 0
Thanks alansidman for the quick reply.
i did copy the vba into the new sheet and change the cell reference. instead i got "block if without end if". also I noticed that the original sheet that uses this vba is not showing time stamp.
I got this vba online, not well-versed with vba. should I use this vba in more than one sheet (different cell reference), what is the right code?
Thanks.
 
Upvote 0
Please tell us what your wanting to do.
Finding a script on the internet and showing it to us and saying it does not do what you want does not help us.
Please explain in words what your wanting to do on both sheets if they are different.
 
Last edited:
Upvote 0
The code requires a second line that states End if

Put it after the first one.
 
Upvote 0
Hi Again, I have 2 worksheet presently, Branch 1 and branch 2. Branch 1 uses the current script (No prob). created Branch 2, the difference between the two sheets are some augmented columns. so cells reference moved.
thought this was merely change cell reference to the script. well i was wrong. so how should the script be written in branch 2 as not to interrupt branch 1's time stamp?
i'm planning to add 3 more in the future. Thanks
 
Upvote 0
The best way to help you is for you to show us all the code you have in both sheets.
 
Upvote 0
Hi all
I was impatience with the outcome without really look deep into details. when i rechecked, the range was off and landed on a locked cell. i was clumsy.
now it's working. thanks for all the help.
 
Upvote 0

Forum statistics

Threads
1,216,471
Messages
6,130,822
Members
449,595
Latest member
jhester2010

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