Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I created a data sheet with excel a

Status
Not open for further replies.

Geokakis

Technical User
Jan 26, 2003
8
DE
I created a data sheet with excel and also wrote a program with VBA code that every changes made on this data sheet is automatically recorded on another sheet indicating the specific cell the changes was made and what value was changed. How can i make it possible that the name of the author of the changes will always appear without having to write it manually

Can you help
 
To return current user name use:

[tt]Application.UserName[/tt]

 
another method is to use

Code:
Environ$("username")

This gives the log-on name of the person logged on to the PC. You'd need to check whether username is one word or not. I can't as the variable doesn't exist on my PC!

;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Loomah - username IS one word but I believe that it only works for NT - other than that you can get the app username as above or you can use an API call to get the log-on username Rgds
Geoff

Estne volumen in toga, an solum tibi libet me videre?
 
Loomah

Lots and lots of thanks the (Application.UserName) has perfectly solve my problem.

Gregards

Geokakis
 
Bear in mind that a user can very easily change teh application.username
within Tools>Options

If you are keeping this log to guard against any malicious work on the spreadsheet, remember that
a: Any user can change the application.username to something completely unhelpful to you
b: this relies on your IT staff setting up the profiles correctly - for instancwe, I know of several people in our company who don't even have a username for excel because it was never set up and they don't know that it exists - and even if they did, are unaware of any usefulness it may have.

If you are on NT - I'd go with environ("username") to be on the safe side Rgds
Geoff

Estne volumen in toga, an solum tibi libet me videre?
 
Since Win2000 is NT-based, you have the environment variable there, as well.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top