Hi everybody,
With the assistance of other people and this forum, I have the following code that captures three values (one of them is time) on a separate sheet.
This works well, but if the operator makes a mistake, there is no easy way of undoing it, because the destination sheet contains a lot of calculations.
Is there a way to undo the last action?
Here is the code:
Thanks in advance
Jo
Win XP, excel 2010
With the assistance of other people and this forum, I have the following code that captures three values (one of them is time) on a separate sheet.
This works well, but if the operator makes a mistake, there is no easy way of undoing it, because the destination sheet contains a lot of calculations.
Is there a way to undo the last action?
Here is the code:
Code:
Sub Enter_click()
Dim NR As Integer 'Next Row
Dim NC As Integer 'Next Col
Dim c As Range
Dim I As Integer
Dim Dest As Worksheet
Dim Src As Worksheet
Set Src = Worksheets("Master")
Set Dest = Worksheets("Overview")
'Find where to put the time on Overview Sheet
Dest.Select
For Each c In Dest.Range("B1:Z1")
If c.Value = Src.Cells(5, 2).Value Then NC = c.Column
Next
I = 1
Do While Dest.Cells(I, NC) <> ""
NR = I
I = I + 1
Loop
NR = NR + 1
'Transfer results to Results sheet
Dest.Cells(NR, NC).Value = Src.Cells(5, 6).Value 'Team
Dest.Cells(NR, NC).NumberFormat = "General"
Dest.Cells(NR, NC + 1).Value = Src.Cells(9, 6).Value 'Time
Dest.Cells(NR, NC + 1).NumberFormat = "hh:mm:ss"
Dest.Cells(NR, NC + 1).Font.Color = 0
Src.Select
End Sub
Thanks in advance
Jo
Win XP, excel 2010