![]() |
Private Sub Workbook Open() - question
Hi,
I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
Private Sub Workbook Open() - question
Anthony,
Add a wait Application.Wait Now() + TimeSerial(0, 0, 5) and then 'open' the other worksheet, whatever you mean by that. Do you want two separate windows, or just bring Log to the active sheet. -- HTH Bob Phillips "Anthony" wrote in message ... Hi, I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
Private Sub Workbook Open() - question
Bob,
no I just want the "front page" to be opened first, to wait around 5 seconds then open (or bring the log to the active sheet) the "log" sheet hope I haven't confused ya cheers Anthony "Bob Phillips" wrote: Anthony, Add a wait Application.Wait Now() + TimeSerial(0, 0, 5) and then 'open' the other worksheet, whatever you mean by that. Do you want two separate windows, or just bring Log to the active sheet. -- HTH Bob Phillips "Anthony" wrote in message ... Hi, I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
Private Sub Workbook Open() - question
Try this:
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) Private Sub Workbook_Open() Worksheet("Front Page").Open Sleep(5000) Worksheet("Log").Open end sub "Anthony" wrote: Bob, no I just want the "front page" to be opened first, to wait around 5 seconds then open (or bring the log to the active sheet) the "log" sheet hope I haven't confused ya cheers Anthony "Bob Phillips" wrote: Anthony, Add a wait Application.Wait Now() + TimeSerial(0, 0, 5) and then 'open' the other worksheet, whatever you mean by that. Do you want two separate windows, or just bring Log to the active sheet. -- HTH Bob Phillips "Anthony" wrote in message ... Hi, I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
Private Sub Workbook Open() - question
Private Sub Workbook_Open()
Worksheets("Front Page").Activate Application.Wait Now() + TimeSerial(0, 0, 5) Worksheets("Log").Activate End Sub -- HTH Bob Phillips "Anthony" wrote in message ... Bob, no I just want the "front page" to be opened first, to wait around 5 seconds then open (or bring the log to the active sheet) the "log" sheet hope I haven't confused ya cheers Anthony "Bob Phillips" wrote: Anthony, Add a wait Application.Wait Now() + TimeSerial(0, 0, 5) and then 'open' the other worksheet, whatever you mean by that. Do you want two separate windows, or just bring Log to the active sheet. -- HTH Bob Phillips "Anthony" wrote in message ... Hi, I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
Private Sub Workbook Open() - question
thanks bob that did the trick
"Bob Phillips" wrote: Private Sub Workbook_Open() Worksheets("Front Page").Activate Application.Wait Now() + TimeSerial(0, 0, 5) Worksheets("Log").Activate End Sub -- HTH Bob Phillips "Anthony" wrote in message ... Bob, no I just want the "front page" to be opened first, to wait around 5 seconds then open (or bring the log to the active sheet) the "log" sheet hope I haven't confused ya cheers Anthony "Bob Phillips" wrote: Anthony, Add a wait Application.Wait Now() + TimeSerial(0, 0, 5) and then 'open' the other worksheet, whatever you mean by that. Do you want two separate windows, or just bring Log to the active sheet. -- HTH Bob Phillips "Anthony" wrote in message ... Hi, I have this code written within my 'Thisworkbook' part of the VB window Private Sub Workbook_Open() Worksheets("Front Page").Activate End Sub basicaly, on openeing the workbook, the "front Page" is shown by default. Is it possible (if so how) to add to this code to do the following..... On opening the workbook, goto "front page" worksheet (as it does now) wait aprox 5 seconds before it opens another worksheet called "Log" both of these workseets are held within the same workbook (named anthony 07oct) thanks in advance |
All times are GMT +1. The time now is 12:38 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com