Hi all,
I'm very new to Excel VBA, and this is my first post - please be gentle :D
What I'm trying to do is probably quite simple to you lot, but I can't seem to find the right combination of VBA and formula to get what I need done! I've been searching for hours.
ex. I enter data in A1, and I want my username to be inserted into C1. I'd like to send the file on to a colleague - User2 - have him enter data in A2, and have his username inserted into C2. He will send to User3, who will enter data in A3, whose name will populate in C3, and so on.
Using the code and formula below, my name populates in C1 perfectly. Problem: User2 opens the file, and C1 now shows his username. Filling in A2 thus inserts his username a second time into C2. You get the idea; obviously, I'd like all our usernames to stay put.
So this is what I'm using:
As a Module:
In the formulas:
Wondering if there's a way to have the formula convert the formula into its value automatically, without having to press F9+enter? Of course, there's probably a better way, so I'll just wait for it...
I'm very new to Excel VBA, and this is my first post - please be gentle :D
What I'm trying to do is probably quite simple to you lot, but I can't seem to find the right combination of VBA and formula to get what I need done! I've been searching for hours.
ex. I enter data in A1, and I want my username to be inserted into C1. I'd like to send the file on to a colleague - User2 - have him enter data in A2, and have his username inserted into C2. He will send to User3, who will enter data in A3, whose name will populate in C3, and so on.
Using the code and formula below, my name populates in C1 perfectly. Problem: User2 opens the file, and C1 now shows his username. Filling in A2 thus inserts his username a second time into C2. You get the idea; obviously, I'd like all our usernames to stay put.
So this is what I'm using:
As a Module:
Code:
Public Function UserName()
UserName = Environ$("username")
End Function
In the formulas:
Code:
[C1] =IF(A1>0,username(),"")
[C2] =IF(A2>0,username(),"")
[C3] =IF(A3>0,username(),"")
etc...
Wondering if there's a way to have the formula convert the formula into its value automatically, without having to press F9+enter? Of course, there's probably a better way, so I'll just wait for it...