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
Bookmarks