Track Changes History sheet (Who changed the last cell)

A

ankur

Hi All,

I have a shared workbooks which records history (Track Changes) of all
change events. What I am trying to achieve to is a macro triggered by
a shortcut, which msgbox the username of the person who last changed
the cell.

The way I do it manually is I go to the history sheet and find out
this cell's address in Histroy sheet (last record) and look at the
user name.

Any help is deeply appreciated.

Regards,
Ankur
 
G

Guest

Let's assume that the last name is in column B of Sheet1

Sub FindLastChange()
Dim myRange As Range
Dim myWS As Worksheet
Dim myWB As Workbook

Set myWB = ActiveWorkbook

Set myWS = Nothing
On Error Resume Next
Set myWS = myWB.Worksheets("Sheet1") '<~~change sheet name here
On Error GoTo 0
If myWS Is Nothing Then
MsgBox ("The worksheet you want doesn't exist")
Exit Sub
End If

Set myRange = myWS.Cells(myWS.Rows.Count, "B").End(xlUp) '<~~~change column
ID here

MsgBox ("The last person to edit the workbook was " & myRange.Value)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top