Issues with timestamp now()

RJGibson

New Member
Joined
May 17, 2019
Messages
14
Hi All,

Any help attained would be great, I am not the best using VBA so hence the query.

I have a sheet where users submit their completed work and a cell calculates the % of work done. I have 4 other cells that have % thresholds from 25%/50%/75%.

Is there a way for me to have a timestamp generated once the threshold ~% of work complete has been added, apologies on the crude example below cant upload images in work :(
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]% Complete[/TD]
[TD]25%[/TD]
[TD]50%[/TD]
[TD]75%[/TD]
[TD]100%[/TD]
[/TR]
[TR]
[TD]RJ[/TD]
[TD]25[/TD]
[TD]Timestamp[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The current code we were using is as follows, is there a way to generate the timestamp one time only in each cell?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range: Set A = Range("A3:A6")
Dim v As String
If Intersect(Target, A) Is Nothing Then Exit Sub

Application.EnableEvents = False
v = Target.Value
If v = "25%" Then Target.Offset(0, 1) = Now()
If v = "50%" Then Target.Offset(0, 2) = Now()
If v = "75%" Then Target.Offset(0, 3) = Now()
If v = "100" Then Target.Offset(0, 4) = Now()
Application.EnableEvents = True
End Sub

Regards,
Ray
 
So, does the revised code that Scott provided work (once you fix the range reference I mentioned in my last post)?
If not, please describe exactly how it is not working, and what exactly is in column M (values or formulas).
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
The code scott provided works provided im manually changing the value of the cell however the completed sheet will be updating that range with a formula and this is where ive got stuck now.
 
Upvote 0
So, there are formulas in column M?
What exactly do those formulas look like (please post one)?
 
Upvote 0
So, there are formulas in column M?
What exactly do those formulas look like (please post one)?

=IFERROR(M33/100*100,"") This turns the percentage into the number the VBA looks for.

This formula references the cell to the left of it where the % number is calculated by the following =L33/L4 where L4 is the number of total assigned tasks. and L33 being total completed tasks and is displayed as a percentage.
 
Upvote 0
Let's keep walking this back (I am trying to find the "source" of the change).
What is in cell L33? Is this being manually updated, or is it another formula?
Really, what we are after is the "source" of all these changes. What is the "base" thing that changes that causes all these formulas to update?

And lastly, can you confirm:
- what column has your 25%, 50%, 75%, 100% percentage amounts?
- what column you want the time stamp in?
 
Upvote 0
Upvote 0
Ok. Lets try and work this out. Sorry if I am not being clear. Working off one particular cell which is M33. Worker A is assigned 20 tasks. M:33 contains the formula =L33/L4 Which outputs a percentage number based on the completed work. The cell N:33 contains the formula =IFERROR(M33/100*100,"") to convert the percentage into an integer so VBA can see it using the formula Scott provided. If I manually change M33 the script works. I am trying to figure out if we can get it to work if Worker A changes any values and increases the percentage number in M33 for VBA too see that change and provide a time stamp at each threshold stated.
 
Upvote 0
image.png
 
Upvote 0
I know what you are trying to do, and I am trying to help you. But in order to do so, it is very important that you answer the exact questions that I ask.
Please look back at post 16 I posted above and answer ALL the questions I asked there.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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