View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Username The Sequel

If you want to call the function from a worksheet cell, place the
code in a standard code module (not the ThisWorkbook code module
and not one of the sheet modules), and call it directly with a
formula like

=UserName()

If you want to call the function from within VBA, use code like

Dim UName As String
UName = UserName()


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"teabag" wrote in message
...
Bob, thank you very much for your prompt help.

Unfortunately I don't know what to do with the code you so

kindly wrote. (No politically incorrect suggestions, please!)
Tried to put it into a cell with the function CALL but couldn't

work out which bits went where.
I have made some usable workbooks using a very wide range of

Excel capabilities (learning from Help) but have never done
Visual Basic; presumably that's my problem!
However, if there is a simple hint you can give me, I'd be very

grateful.
Otherwise I guess I'll have to look for a programmer who is

willing to do this one thing...

In any case, thanks again. Oh - your email reply address

bounced...

teabag.