+ Reply to Thread
Results 1 to 6 of 6

Get Username - but only once

Hybrid View

  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Get Username - but only once

    Maybe (untested)
    Private Sub Workbook_Open()
        With Worksheets("Sheet1").Range("A1")
            If Me.Name Like "*.xlt*" Then
                .Value = vbNullString
            ElseIf .Value = vbNullString Then
                .Value = Environ("username")
            End If
        End With
    End Sub
    Entia non sunt multiplicanda sine necessitate

  2. #2
    Forum Contributor
    Join Date
    01-11-2011
    Location
    Frederick, MD, USA
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Get Username - but only once

    Shoot...I need to get in the practice of stating all my restrictions on these, too. Because the ultimate template will actually be launched from another program that gets a little finicky, I am restricted from using anything that activates upon open of the worksheet, as it appears this one does. I'm still testing whether "on activate" of a particular worksheet will work, but I doubt it will. (I've heard that "on modification" of a certain cell is possible, but I can't find the way to write that, and I'm not certain it would work in this instance anyway; I understand that requires an active modification of a cell, which this would not be.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1