Worksheet Function not refreshing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a excel file which is used by several people and I wanted it to show
who was using it at the moment so I wrote

Public Function CurrUserName(Workbook) As String
CurrUserName = Application.UserName
End Function

This does work but is only updated when someone clicks inside the cell and
then hits return.

How Can I get this to autommatically recalculate whenever someone opens the
file.
 
Mark said:
I have a excel file which is used by several people and I wanted it to show
who was using it at the moment so I wrote

Public Function CurrUserName(Workbook) As String
CurrUserName = Application.UserName
End Function

This does work but is only updated when someone clicks inside the cell and
then hits return.

How Can I get this to autommatically recalculate whenever someone opens the
file.

You need to use Appplication.Volatile

Public Function CurrUserName(Workbook) As String
Application.Volatile True
CurrUserName = Application.UserName
End Function

/Fredrik
 

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

Back
Top