Detecting New Entry or Changes

mikemmb

Board Regular
Joined
Mar 4, 2009
Messages
59
Hi,
I have what seems a fairly simple question that I cannot find a clear answer too on the forum.

I have a log of driver movements, A7:A1000 hold the individual driver ID's as they enter the depot. B7:J1000 holds various records about the drivers movements including importantly a time stamp of when the driver arrived (ie when his ID was entered into the next blank cell in Column A).

Currently the arrival Time Stamp entry is triggered by a sub looking for a "SelectionChange" within column A and all this works fine ................. except when we get the drivers ID wrong and we need to correct it later.

What it does now is create a new (wrong from the drivers perspective!) Time Stamp for arrival because it detects the Change and updates the time stamp.

Is there a way to NOT see a change of Driver ID as a new event and leave the time stamp as was (ie only trigger the Time Stamp Sub if a Column A blank cell has data entered into it)?

CODE BELOW:
Private Sub Worksheet_Change1(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub

If Not Intersect(Range("A7:A1000"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
'.Offset(0, 5).ClearContents

.Offset(0, 6).ClearContents
Else
With .Offset(0, 6)
.NumberFormat = "hh:mm:ss"
.Value = time

End With

End If
Application.EnableEvents = True
End If
End With

End Sub


Thanks,
Mike
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,202,901
Messages
6,052,445
Members
444,581
Latest member
naninamu

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