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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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