Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Update cell automatically

Hello,

I have this code that gets the username:

Function UserName() As String
UserName = Environ("UserName")
End Function

I call this code in a cell as follows:

="Summary for " & VLOOKUP(UserName(),Sheet1!B34:C100,2,FALSE)

The workbook is a shared workbook and this works fine for me however it
doesnt update for any other user. When they open it, if they click in the
formula bar of the cell and press enter then it updates.

Does anyone know how to update the cell automatically?

Thanks in advance,

Martin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Update cell automatically


Excel usually calculates on open, however you can put
Code:
--------------------
Private Sub Worksheet_Activate()
Me.Calculate
End Sub
--------------------
in the worksheet code module, that should do the trick!Martin;191464 Wrote:
Hello,

I have this code that gets the username:

Function UserName() As String
UserName = Environ("UserName")
End Function

I call this code in a cell as follows:

="Summary for " & VLOOKUP(UserName(),Sheet1!B34:C100,2,FALSE)

The workbook is a shared workbook and this works fine for me however
it
doesnt update for any other user. When they open it, if they click in
the
formula bar of the cell and press enter then it updates.

Does anyone know how to update the cell automatically?

Thanks in advance,

Martin



--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52757

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Update cell automatically

Thanks for the reply. I tried this and I can still open the file and as it
worked for me originally I dont know if it has had any effect as nobody else
can even open the file now, it says Automation Error (440).

I have looked this up and all the relevant references are ticked so I am at
a complete loss as to why nobody can open it except me.

Do you have any ideas on this?

Thank you for your help

Martin

"The Code Cage Team" wrote:


Excel usually calculates on open, however you can put
Code:
--------------------
Private Sub Worksheet_Activate()
Me.Calculate
End Sub
--------------------
in the worksheet code module, that should do the trick!Martin;191464 Wrote:
Hello,

I have this code that gets the username:

Function UserName() As String
UserName = Environ("UserName")
End Function

I call this code in a cell as follows:

="Summary for " & VLOOKUP(UserName(),Sheet1!B34:C100,2,FALSE)

The workbook is a shared workbook and this works fine for me however
it
doesnt update for any other user. When they open it, if they click in
the
formula bar of the cell and press enter then it updates.

Does anyone know how to update the cell automatically?

Thanks in advance,

Martin



--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=52757


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update cell automatically Martin Excel Programming 0 January 21st 09 08:30 AM
Cell update - Automatically Apoorva Excel Discussion (Misc queries) 1 June 12th 08 11:39 AM
Cell doesn't update automatically even when Calculations are on Au J@Y Excel Discussion (Misc queries) 3 June 21st 07 08:48 PM
Automatically update a cell Adriana Excel Worksheet Functions 2 June 8th 07 04:23 AM
Automatically update cell value Kaitlin.uk Excel Discussion (Misc queries) 2 February 12th 07 11:57 AM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"