Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Auto macro in Excel help

Hi all,

I have a workbook with multiple sheets. I want the sheet 1 always to
display first and is there a method to display the current user name which
updates it self automatically when different users use the book when its on
a share - I'm thinking of setting up a log. I've done the following as a
test but its not really what I want - ideally there would be a text box that
auto changes without it having to be clicked.

Sub logontest()
Worksheets("Frontscreen").Activate
Dim x
Set x = CreateObject("WSCRIPT.Network")
Dim u
u = x.UserName



'update text box "Last Updated:"
ActiveSheet.TextBoxes("txtLogon").Text = "Current Logon : " & u
End Sub


  #2   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto macro in Excel help

Call you code from the workbook_open event

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy

"sacrum" wrote in message
...
Hi all,

I have a workbook with multiple sheets. I want the sheet 1 always to
display first and is there a method to display the current user name which
updates it self automatically when different users use the book when its

on
a share - I'm thinking of setting up a log. I've done the following as a
test but its not really what I want - ideally there would be a text box

that
auto changes without it having to be clicked.

Sub logontest()
Worksheets("Frontscreen").Activate
Dim x
Set x = CreateObject("WSCRIPT.Network")
Dim u
u = x.UserName



'update text box "Last Updated:"
ActiveSheet.TextBoxes("txtLogon").Text = "Current Logon : " & u
End Sub




  #3   Report Post  
Posted to microsoft.public.office.developer.vba,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Auto macro in Excel help


"Tom Ogilvy" wrote in message
...
Call you code from the workbook_open event

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy

"sacrum" wrote in message
...
Hi all,

I have a workbook with multiple sheets. I want the sheet 1 always to
display first and is there a method to display the current user name
which
updates it self automatically when different users use the book when its

on
a share - I'm thinking of setting up a log. I've done the following as a
test but its not really what I want - ideally there would be a text box

that
auto changes without it having to be clicked.

Sub logontest()
Worksheets("Frontscreen").Activate
Dim x
Set x = CreateObject("WSCRIPT.Network")
Dim u
u = x.UserName



'update text box "Last Updated:"
ActiveSheet.TextBoxes("txtLogon").Text = "Current Logon : " & u
End Sub



Thanks - now sorted.


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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Auto macro in Excel help sacrum Excel Discussion (Misc queries) 2 January 17th 06 09:30 PM
Excel auto-start macro RDCLARK Excel Programming 3 October 5th 04 07:21 PM
Auto Formatting Excel Macro Peter Hewett Excel Programming 1 May 14th 04 08:21 AM
Excel auto macro problems Georgie[_3_] Excel Programming 1 February 1st 04 02:11 AM


All times are GMT +1. The time now is 07:38 AM.

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"