+ Reply to Thread
Results 1 to 7 of 7

Automated username VBA not working

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    44

    Automated username VBA not working

    HI,

    I have the following VBA code to add a username to a certain cell in column AL if there is any changes has been done in column AA

    Please Login or Register  to view this content.
    it was working, but now it seems it is not working, Please help

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Automated username VBA not working

    Try this:

    Please Login or Register  to view this content.
    Last edited by berlan; 02-02-2014 at 03:57 PM. Reason: correction: no need to change, your code was running fine

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Automated username VBA not working

    First check if the code is running at all by putting a breakpoint in the code or inserting a BEEP line. If not check the value of Application.EnableEvents. If this is false, change it to true by typing

    Please Login or Register  to view this content.
    into the immediate window.

    If it is running, then you could try Application.UserName as an alternative to Environ$("USERNAME")
    Martin

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Automated username VBA not working

    Your first code works fine for me by the way, perhaps you have turned EnableEvents off after receiving an error?

  5. #5
    Registered User
    Join Date
    01-28-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automated username VBA not working

    How do I turn the EnableEvents on

  6. #6
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Automated username VBA not working

    For instance run another macro enabling it.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-28-2014
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automated username VBA not working

    Thank you all. It seems there was a small error, I restarted my file and now is is working. But what do I add to the VBA code to restrict is only to column AA and column AL. When I edit a cell in column AB it adds the username in AM, which has a vlookup/hyperlink formula in

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Username and Password Form - Show Username in Sheet
    By ryan180 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 07:06 PM
  2. Replies: 0
    Last Post: 05-01-2012, 05:25 AM
  3. Get Username - but only once
    By Gunther Maplethorpe in forum Excel General
    Replies: 5
    Last Post: 07-29-2011, 01:53 PM
  4. NT Username
    By ceemo in forum Excel General
    Replies: 4
    Last Post: 08-02-2005, 11:39 AM

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