ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Track Changes History sheet (Who changed the last cell) (https://www.excelbanter.com/excel-programming/397386-track-changes-history-sheet-who-changed-last-cell.html)

ankur

Track Changes History sheet (Who changed the last cell)
 

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


Barb Reinhardt

Track Changes History sheet (Who changed the last cell)
 
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

--
HTH,
Barb Reinhardt



"ankur" wrote:


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




All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com