Dear Friends,
Need your support on subjected Query: -
Please refer below code which is working completely fine for me, Except where Red Highlighted!!!
ActiveCell.Row & ActiveCell.Column goes to next Row or next Column based on User Press Tab or Enter Respectively after entry in a current cell!
Requesting you to provide your valuable suggestion, How to Select previous active cell in both the cases, so that it extracts right value from “Data” sheet and paste in “LogDetails” sheet!
Dim Oldvalue As String
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.Name = "Data" Then
If Not Intersect(Target, Sh.Range("AO2:EE1000")) Is Nothing Then
Application.EnableEvents = False
With Worksheets("LogDetails")
.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = UCase(Environ("username"))
.Range("A" & Rows.Count).End(xlUp).Offset(0, 1).Value = Format(Now, "DD-MMM-YYYY HH:MM:SS")
.Range("A" & Rows.Count).End(xlUp).Offset(0, 2).Value = Cells(ActiveCell.Row, "AN").Value
.Range("A" & Rows.Count).End(xlUp).Offset(0, 3).Value = Cells(1, ActiveCell.Column).Value
.Range("A" & Rows.Count).End(xlUp).Offset(0, 4).Value = Oldvalue
.Range("A" & Rows.Count).End(xlUp).Offset(0, 5).Value = Target.Value
End With
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Oldvalue = Target.Value
End Sub
Thanks & Regards,
Rajeshkumar R
Bookmarks