Auto print
How do I get to print sheet2 every monday at 100:00am. Can the formula below
be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
hi.
macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
You may be better off to use Task Scheduler to start Excel, open the workbook
and have an Auto_Open sub run the print job. Gord Dibben MS Excel MVP On Wed, 3 Oct 2007 12:50:02 -0700, FSt1 wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
Thanks fst1
Where would I put the sheet to be printed, in this case sheet5 -- Geo "FSt1" wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
Thanks Gord,
If I went that way how would the code be written to auto_open sub run the print job? -- Geo "Gord Dibben" wrote: You may be better off to use Task Scheduler to start Excel, open the workbook and have an Auto_Open sub run the print job. Gord Dibben MS Excel MVP On Wed, 3 Oct 2007 12:50:02 -0700, FSt1 wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
In a general module:
Option Explicit Sub Auto_Open() worksheets("Sheet5").printout 'close the workbook??? thisworkbook.close savechanges:=false end sub Remember that each time you open this workbook, this macro will run. You can turn off macros and open it or hold the shift key down while opening the workbook to avoid running this code. Geo wrote: Thanks Gord, If I went that way how would the code be written to auto_open sub run the print job? -- Geo "Gord Dibben" wrote: You may be better off to use Task Scheduler to start Excel, open the workbook and have an Auto_Open sub run the print job. Gord Dibben MS Excel MVP On Wed, 3 Oct 2007 12:50:02 -0700, FSt1 wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo -- Dave Peterson |
Auto print
Thanks Dave.
Must have missed Geo's reply to my reply Gord On Wed, 03 Oct 2007 16:13:41 -0500, Dave Peterson wrote: In a general module: Option Explicit Sub Auto_Open() worksheets("Sheet5").printout 'close the workbook??? thisworkbook.close savechanges:=false end sub Remember that each time you open this workbook, this macro will run. You can turn off macros and open it or hold the shift key down while opening the workbook to avoid running this code. Geo wrote: Thanks Gord, If I went that way how would the code be written to auto_open sub run the print job? -- Geo "Gord Dibben" wrote: You may be better off to use Task Scheduler to start Excel, open the workbook and have an Auto_Open sub run the print job. Gord Dibben MS Excel MVP On Wed, 3 Oct 2007 12:50:02 -0700, FSt1 wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
Auto print
You're forgiven <vvbg.
Gord Dibben wrote: Thanks Dave. Must have missed Geo's reply to my reply Gord On Wed, 03 Oct 2007 16:13:41 -0500, Dave Peterson wrote: In a general module: Option Explicit Sub Auto_Open() worksheets("Sheet5").printout 'close the workbook??? thisworkbook.close savechanges:=false end sub Remember that each time you open this workbook, this macro will run. You can turn off macros and open it or hold the shift key down while opening the workbook to avoid running this code. Geo wrote: Thanks Gord, If I went that way how would the code be written to auto_open sub run the print job? -- Geo "Gord Dibben" wrote: You may be better off to use Task Scheduler to start Excel, open the workbook and have an Auto_Open sub run the print job. Gord Dibben MS Excel MVP On Wed, 3 Oct 2007 12:50:02 -0700, FSt1 wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo -- Dave Peterson |
Auto print
Thanks all,
The code that works as follows: Private Sub Workbook_Open() Application.ScreenUpdating = False Sheet1.Activate If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("00:52:00"), "Macro1" Else Exit Sub End If Sheet1.Activate Application.ScreenUpdating = True End Sub With task scheduling, one still needs to enable macros for it to proceed. So not totally automatic. No way round that i supose!!? -- Geo "FSt1" wrote: hi. macro's don't start themselves. they are triggered by some event. you could put this code in the workbook open event so that each morning this code would check to see if it's monday yet. or if the file is not open, you could put it in your personal workbook in the xl startup folder so that the code will fire when you open excel. add a line to open the file and print. your job... your call. but you will need a way to trigger it. and the file will have to be open. If Weekday(Now()) = 2 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect Application.OnTime TimeValue("10:00:00"), "Print_Out" Else Exit Sub End If If it's monday, the on time event will wait untill 10 then call Print_out. if it's not monday, the code quits. Regards FSt1 "Geo" wrote: How do I get to print sheet2 every monday at 100:00am. Can the formula below be modified and used? Sub timer() Application.OnTime TimeValue("10:00:00"), "Print_Out" End Sub -- Geo |
All times are GMT +1. The time now is 06:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com