record changes to a worksheet - (2)

BebeM

New Member
Joined
Sep 29, 2022
Messages
19
Office Version
  1. 365
  2. 2021
  3. 2013
Platform
  1. Windows
@ Joe4
I recently used one of your codes:

"Private Sub Worksheet_Change(ByVal Target As Range)

' Log "UPDATE" to bottom of Log sheet whenever change made to BOB sheet
Dim lr As Long
' Find last row in column A on Log sheet with data
lr = Sheets("Log").Cells(Rows.Count, "A").End(xlUp).Row
' See if current value in that cell is "UPDATE"
If Sheets("Log").Range("A" & lr).Value = "UPDATE" Then
' Do nothing -- changes have already been flagged for updating
Else
' Put "UPDATE" in next available row in column A on Log sheet
Sheets("Log").Range("A" & lr + 1).Value = "UPDATE"
End If

End Sub"


and we thank you for it.
Can I ask if it’s possible to insert another column on Log sheet (meaning, User+date+cell name)?

I tried adding
Sheets("Log").Range("C" & lr + 1).Value (E.G., I want to add Description)
and I get an error

your help is appreciated
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Please post your actual code so we can analyze it?
Please be sure to use code tags when posting your code for readability.
See: How to Post Your VBA Code
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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