VBA to save most recent users name

ILMWT

New Member
Joined
Dec 9, 2014
Messages
35
Hi all,

I am looking for a VBA that, when the excel doc is opened, will ask the user to input their name into a textbox before they are allowed access to the spreadsheet. When the spreadsheet is then saved it will save that users name and the time the saved it in a cell. Doesn't matter which one, lets just go with H1. When someone else saves the document, that cell will change to reflect the new saver.

Someone is deleting data from a spreadsheet, and everyone shows up as admin. So this, I imagine, would be a good way to find out who is doing it.

Thank you all!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I have searched for this a bit, and have seen that one. The issue is, I don't see that it fits the criteria of asking the user to input their name into a textbox in order for them to access the spreadsheet. If they do not, then the spreadsheet closes. Saving the username from what they type in the textbox as opposed to grabbing the username via the standard username functions in excel if you know what I mean.
 
Upvote 0
it doesn't ask it does it automatically from calling the username from the windows login thus giving you independent tracing of user

one of the reasons for doing it this way (unless multiple user have access to same machine without logging in) is that you need no error checking procedure to confirm task completed also you would still need an OnClose procedure to confirm the update has been completed or at least to post a confirm message box to user.

to restrict them even opening the spreadsheet with out entering username the same code could be entered into the OnOpen Event so it would populate the field with name and you could even pop up a message box saying Welcome UserName

id they are being clever and change the username field no matter as you are saving it on close anyhows
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,545
Members
449,317
Latest member
chingiloum

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