Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
~C ~C is offline
external usenet poster
 
Posts: 3
Default Refresh Code Question

I have the following code in a spreadsheet:

Function NetworkUserName() As String
Dim response
NetworkUserName = Environ("Username")
Application.Volatile
End Function


I have placed this worksheet on our company network so that many people can
access it. However, it saves my username and does not refresh to display the
current user's information unless they go to that cell and press Enter. How
can I get it to refresh when the file is opened?

Thanks!

~C
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Refresh Code Question

'-----------------------------------------------------------------
Private Sub Workbook_Open()
'-----------------------------------------------------------------
Worksheets("Sheet1").Range("A1").Value = Environ("Username")
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"~C" wrote in message
...
I have the following code in a spreadsheet:

Function NetworkUserName() As String
Dim response
NetworkUserName = Environ("Username")
Application.Volatile
End Function


I have placed this worksheet on our company network so that many people

can
access it. However, it saves my username and does not refresh to display

the
current user's information unless they go to that cell and press Enter.

How
can I get it to refresh when the file is opened?

Thanks!

~C



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
web refresh question teepee[_3_] Excel Discussion (Misc queries) 2 January 5th 09 02:54 PM
Code To Refresh Query Table Carl Excel Discussion (Misc queries) 0 December 8th 06 01:23 AM
XML Refresh Code wayliff[_8_] Excel Programming 0 January 12th 06 07:06 PM
Code to Refresh Pivot Table S Jackson Excel Programming 1 August 31st 05 05:40 PM
refresh worksheet code nowfal[_44_] Excel Programming 2 August 20th 05 04:28 AM


All times are GMT +1. The time now is 10:39 PM.

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

About Us

"It's about Microsoft Excel"