View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Pop-up Combo Box

Brad,

don't bother. Use this function to get the user name

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

Public Function UserName() As String
Dim sName As String * 256
Dim cChars As Long
cChars = 256
If GetUserName(sName, cChars) Then
UserName = Left$(sName, cChars - 1)
End If
End Function

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Brad E" wrote in message
...
There is a spreadsheet which four people will be using,
and I need to know which of the four will be using for
formatting. Upon opening the 'template' workbook, I would
like a pop-up drop-down list of the user's names, which
they will have to select before entering on the
spreadsheet.
I would like to know two things: 1)how do I make the Combo
Box pop-up, 2)how do I make this pop up when the workbook
is open?
Thanks, Brad E.