+ Reply to Thread
Results 1 to 2 of 2

Username and Password Form - Show Username in Sheet

  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    Coventry, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Username and Password Form - Show Username in Sheet

    I've had some assistance with an Excel report where access to the report is governed by a VB login box.

    The code for the login functionality works as it should, but I now need to amend this somehow to pass the "logged-in" user to a cell in one of the spreadsheets. I'll then use IF statements and VLOOKUPS to dictate the data that the user will see relative to their Username, referencing this cell value.

    I'm by no means a VB expert, so I'd very much appreciate some assistance with amending the following code in order to achieve the above. If separate code (for a separate spreadsheet) is required, advice for this would also be appreciated!

    Form:

    Please Login or Register  to view this content.
    "ThisWorkbook"

    Please Login or Register  to view this content.
    I'm under a bit of pressure at work to get this done, so some expert advice would be great!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,530

    Re: Username and Password Form - Show Username in Sheet

    Quote Originally Posted by ryan180 View Post
    pass the "logged-in" user to a cell in one of the spreadsheets.
    Do you mean copy the user name into a cell? That's straightforward, but I can't show you the exact code without knowing what worksheet and what cell. Nonetheless, insert the red code where shown and change "one of the spreadsheets" to the actual name of the worksheet, and A1 to the actual cell. If the worksheet is Sheet2, see alternate code.

    Form:

    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 01-24-2013 at 07:07 PM. Reason: removed unecessary quoting and code
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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