Time Stamp ID

L

Legacy 436357

Guest
Hello,

This code places history of changes to cell H44 starting in J3. Can this code be edited to also put the value of H3 starting in K3.

Thank you very much


Excel Workbook
JK
1Total Invoice History
2Invoice TotalsInvoice Number
3$ 140.00
4$ 660.00
5$ 130.00
Lookup Invoice





Code:
Dim xVal As String

Private Sub Worksheet_Change(ByVal Target As Range)
    Static xCount As Integer
    Application.EnableEvents = False
    If Target.Address = Range("H44").Address Then
        Range("J3").Offset(xCount, 0).Value = xVal
        xCount = xCount + 1
    Else
        If xVal <> Range("H44").Value Then
         Range("J3").Offset(xCount, 0).Value = xVal
        xCount = xCount + 1
        End If
    End If
    Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    xVal = Range("H44").Value
End Sub
 

Some videos you may like

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,702
Office Version
2007
Platform
Windows
Try this

Code:
Dim xVal As String


Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.Address(0, 0) = "H44" Then
    Range("J" & Rows.Count).End(xlUp)(2).Value = xVal
  End If
  If Target.Address(0, 0) = "H3" Then
    Range("K" & Rows.Count).End(xlUp)(2).Value = xVal
  End If
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Not Intersect(Target, Range("H44, H3")) Is Nothing Then
    xVal = Target
  End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,098,991
Messages
5,465,863
Members
406,451
Latest member
KARANDREA

This Week's Hot Topics

Top