Sub RemoveToolBar()
On Error Resume Next
Application.CommandBars("ExcelVBADummies").Delete
End Sub
Sub Main()
Debug.Print FirstName()
End Sub
Function FirstName()
Dim FullName As String
Dim FirstSpace As Integer
FullName = Application.userName
FirstSpace = InStr(FullName, " ")
If FirstSpace = 0 Then
FirstName = FullName
Else
FirstName = Left(FullName, FirstSpace - 1)
End If
End Function
|