+ Reply to Thread
Results 1 to 2 of 2

Current user and current date in excel

  1. #1
    Registered User
    Join Date
    09-10-2019
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2013
    Posts
    2

    Current user and current date in excel

    Hi there,

    I have a table in Excel. A few of the cells there have a code with if condition and based on the result they fill certain cell with the current user or with the current date (today). However there is a bug that occurs. Once another user tries to modify the file all fields with the old users are being changed to the current user and the day is being changed as well. I managed to fix the issues (at least i thought so) but it still occurs sometimes. Any ideas how to fix that?

    So my tables has headers. The first header is called agent's number.

    Basically originally the formula was based on the header column which was refreshing my results from the formulas every time. So I changed it to the address of the cell instead of the entire column and that kinda fixed the bug but it still occurs sometimes. I'm using module functions for the username and the date and also I'm using an if condition to fill certain cells based on the outcome of the if condition. I'll try to post the code as well but for now I'm not allowed. Hope this explanation is good enough.

    Here's the code:

    The old codes was =IF([[Agent''s number]]="","",Username()) and =IF([[Agent''s number]] = "", "", ThisDay()) which were causing this.

    I changed them to =IF(A2="","",Username()) and =IF(A2 = "", "", ThisDay())[/CODE] and it kinda fixed the issue but the bug happened again today.

    Username() and ThisDay() are module functions and here's the code for them.

    Public Function UserName()
    UserName = UCase(Left(Split(Environ$("UserName"), ".")(0), 1)) & LCase(Mid(Split(Environ$("UserName"), ".")(0), 2)) & " " & UCase(Left(Split(Environ$("UserName"), ".")(1), 1)) & LCase(Mid(Split(Environ$("UserName"), ".")(1), 2))
    End Function

    Public Function ThisDay()
    ThisDay = Date
    End Function

    Please let me know if you have any additional question regarding the issues so that I can provide them to you.

    Thank you in advance.

    Kind regards,

    Vladi
    Last edited by vladig; 09-10-2019 at 04:43 PM.

  2. #2
    Registered User
    Join Date
    09-10-2019
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Current user and current date in excel

    Don't know how to delete this one. Added by mistake
    Last edited by vladig; 09-10-2019 at 04:44 PM.

+ 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] Finding the most current and previous current date based on multiple criteria
    By tkbuc in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-27-2016, 06:06 PM
  2. [SOLVED] Set PivotTable Filter to Current Day, Current Week, Current Month, or Current Year
    By EnigmaMatter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2014, 08:31 AM
  3. [SOLVED] copy and paste in current active cell, and need current date then scroll down 140 lines
    By vengatvj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2013, 03:40 AM
  4. [SOLVED] Need average of days for date values from date to current day that updates current date
    By FinGhost in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2013, 04:41 PM
  5. Replies: 3
    Last Post: 06-25-2013, 03:35 PM
  6. adding current date then after saving the file current date function stops
    By gotbitey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 02:15 PM
  7. [SOLVED] Can I automatically enter the current date or current time into a
    By Ben in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 10-19-2005, 11:05 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