View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default Worksheet Function not refreshing


"Mark" wrote in message
...
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.
--
Cheers

Mark


You need to use Appplication.Volatile

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

/Fredrik