User Function Update upon opening

A

AussieOwl

I've created a function module with the following
function:-

Function User()
User = Application.UserName
EndSub

Cell A1 now has a formula " =User()"

This returns the User name to the cell as required.
Ie "Joe Bloggs"

Now if "Joe Bloggs" saves the workbook and another
user "Jim Smith" opens the workbook "Joe Bloggs" still
appears in Cell A1.

Deleting the contents of Cell A1 and re-entering the
function "=User()" will now return "Jim Smith" as the
user as required.

So my question is how to get excel to update the user
upon opening the workbook automatically without deleating
and re-entering the User function.

I'm using Excel 97

Any idea's gang???
 
A

Arvi Laanemets

Hi

In such form it doesn't work at all - replace last row.

Function User()
Application.Volatile
User = Application.UserName
End Function


About the function value not refreshed, you can try to make the function
volatile (look above), but I'm not sure about it, maybe you have to write an
Open event, which forces recalculation at workbooks opening. When different
user opens the workbook, then from Excel point of view nothing in workbook
is changed, and all formulas are left as they are.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top