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
sacrum
 
Posts: n/a
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
Tom Ogilvy
 
Posts: n/a
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
sacrum
 
Posts: n/a
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
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Relative Ranges in excel macro edself Excel Discussion (Misc queries) 6 October 13th 05 02:02 PM
Relative Ranges in excel macro edself Excel Worksheet Functions 6 October 13th 05 02:02 PM
Macro in Excel ByB Excel Discussion (Misc queries) 0 October 5th 05 09:39 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM


All times are GMT +1. The time now is 10:06 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"