Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
bradasley
 
Posts: n/a
Default Show username in a cell

How can I get a username to appear in a cell?

Thanks

David
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Show username in a cell

With code........change the A1 as desired......

Sub username()
Range("A1").Value = ThisWorkbook.BuiltinDocumentProperties("author")
End Sub

Vaya con Dios,
Chuck, CABGx3



"bradasley" wrote:

How can I get a username to appear in a cell?

Thanks

David

  #3   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Show username in a cell

To get the user's logon name, use a VBA function like

Declare Function GetUserName Lib "advapi32.dll" Alias
"GetUserNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long


Function GetLogonName() As String
Dim N As Long: N = 255
Dim S As String
S = String(N, " ")
GetUserName S, N
GetLogonName = Left(S, N - 1)
End Function

You can then call this from a cell with =GetLogonName()

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


"bradasley" wrote in
message
...
How can I get a username to appear in a cell?

Thanks

David



  #4   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Show username in a cell

look here
http://tinyurl.com/qqsm8
or
editnamedefinename it whatever you like such as ws
in the refers to box type =get.workspace(26)ok

then, in a cell, just type in =ws

--
Don Guillett
SalesAid Software

"bradasley" wrote in message
...
How can I get a username to appear in a cell?

Thanks

David



  #5   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Show username in a cell

How cool that is Don!!..................a keeper here.

Vaya con Dios,
Chuck, CABGx3



"Don Guillett" wrote:

look here
http://tinyurl.com/qqsm8
or
editnamedefinename it whatever you like such as ws
in the refers to box type =get.workspace(26)ok

then, in a cell, just type in =ws

--
Don Guillett
SalesAid Software

"bradasley" wrote in message
...
How can I get a username to appear in a cell?

Thanks

David




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
=IF cell needs to show blank if blank Boethius1 Excel Discussion (Misc queries) 5 March 1st 06 05:36 PM
Want #VALUE! to show as blank cell JoeyW Excel Worksheet Functions 2 November 4th 05 09:24 AM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Problem with IF condition or vector lookup? J-Philippe Excel Worksheet Functions 4 January 15th 05 08:41 PM
cell reference show cell name (ie. D45) and not cell value ria Excel Worksheet Functions 4 November 6th 04 04:38 AM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"