Hi friends,
I am stuck in a VBA problem. actually, the code is printing the value twice in subsequent rows its working fine on my previous excel version 2007 but now I shifted to office 365 and its printing the values twice whenever the cell changes.
Attached photo for clarification see timing it printing the value twice in the same second.
Thanks
I am stuck in a VBA problem. actually, the code is printing the value twice in subsequent rows its working fine on my previous excel version 2007 but now I shifted to office 365 and its printing the values twice whenever the cell changes.
Attached photo for clarification see timing it printing the value twice in the same second.
Thanks
VBA Code:
Private Sub Worksheet_Calculate()
If Time >= TimeSerial(9, 25, 2) And Time <= TimeSerial(20, 29, 59) Then
capturerow = 2
currow = Cells(Rows.Count, 1).End(xlUp).Row
Cells(currow + 1, 1) = Cells(capturerow, 1)
Cells(currow + 1, 2) = Cells(capturerow, 2)
Else
Exit Sub
End If
End Sub
VBA Code:
Private Sub worksheet_change(ByVal target As Range)
Dim Cell As Range
For Each Cell In target
If Cell.Column = Range("A:A").Column Then
If Cell.Value <> "" Then
Cells(Cell.Row, "c").Value = Format(Now(), "HH:MM:SS")
End If
End If
Next Cell
End Sub