Excel - Last Modified User in different sheets

stellalol

New Member
Joined
Mar 30, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have been trying to make a cell show the last modified user.
I am using this code

Function getLastModifiedUser()
getLastModifiedUser = ActiveWorkbook.BuiltinDocumentProperties("Last Author")
End Funtion

Problem is, I have two sheets that have the same exact format as to the Last Motified User Cells
Could each sheet have a different Last Modified User name? Is that possible?

Thanks in advance guys!
 
Hi stellalol. The only way that the date would show as blank is if the code to set the date wasn't in that sheet. So, in every sheet that you want record last user and last date, you need to have the following code:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    SetVar "LU_" & Me.Name, Env_UserName()
    SetVar "LU_" & Me.Name & "_Date", Format(Date, "Short Date")
End Sub

The first SetVar saves the user name, the second SetVar saves the date, so they both need to be there.
 
Upvote 0

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi stellalol. The only way that the date would show as blank is if the code to set the date wasn't in that sheet. So, in every sheet that you want record last user and last date, you need to have the following code:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    SetVar "LU_" & Me.Name, Env_UserName()
    SetVar "LU_" & Me.Name & "_Date", Format(Date, "Short Date")
End Sub

The first SetVar saves the user name, the second SetVar saves the date, so they both need to be there.
Yes!! You are right!!! I had forgotten to add the code that has the date! You were very helpful @CephasOz !
Many thanks!
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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