Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't get a reply to incrementing dates so I manually wrote a macro that
would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you mean this ?
If you fill in 3 it will print the sheet three times with another date Delete "preview:=True" if it is working corect Sub PrintCopies_ActiveSheet() Dim CopiesCount As Long Dim CopieNumber As Long Range("I1").Value = "1/1/2004" CopiesCount = Application.InputBox("How many Copies do you want", Type:=1) For CopieNumber = 1 To CopiesCount ActiveSheet.PrintOut preview:=True Range("I1").Value = Range("I1").Value + 1 Next CopieNumber End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you need the following line
Selection.PrintOut Copies:=1, Collate:=True after each Application.Goto Reference:="Print_Area" "lschuh" wrote: I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I figured that out by recording a macro (cheat) and inputting Jan 1, 04 - Jan
31, 04. When looking at the code of the macro i saw what the problem was. Now I have a new problem. I have 31 dates for January 2004. They are written as follows ActiveCell.FormulaR1C1 = "1/1/2004" I want to replace all the "1" with "2" to run the macro for the next month. Where do I find the syntax to replace this or does it need another macro to do it. Additionally I would have liked to have something like a start date and an end date which would have performed the same actions with many fewer lines. I did not know how to write that. I did see pieces of several codes but did not know how to adapt my needs to it. "justahelper" wrote: you need the following line Selection.PrintOut Copies:=1, Collate:=True after each Application.Goto Reference:="Print_Area" "lschuh" wrote: I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
no I just need 1 copy printed from each day in the entire year. The
spreadsheet has been set up to insert a date into cell I1. This has to be done for each day separately. Bummer. What I wanted originally was to do this with some vba code or a macro that would either let me insert the start date and the macro would run, print a page, then goto cell I1 and change the date to the next day of the month and would run until it reached an ending date. I cheated with a macro and like my answer to justahelper had to input all 31 days manually. Now I don't know a way to replace the "1/1/2004" to do the month of February, and so on. Any help is appreciated. "Ron de Bruin" wrote: Do you mean this ? If you fill in 3 it will print the sheet three times with another date Delete "preview:=True" if it is working corect Sub PrintCopies_ActiveSheet() Dim CopiesCount As Long Dim CopieNumber As Long Range("I1").Value = "1/1/2004" CopiesCount = Application.InputBox("How many Copies do you want", Type:=1) For CopieNumber = 1 To CopiesCount ActiveSheet.PrintOut preview:=True Range("I1").Value = Range("I1").Value + 1 Next CopieNumber End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you try the macro ?
If you enter 30 it will print 30 pages with in the first 1/1/2004 the seconf 1/2/2004..... -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... no I just need 1 copy printed from each day in the entire year. The spreadsheet has been set up to insert a date into cell I1. This has to be done for each day separately. Bummer. What I wanted originally was to do this with some vba code or a macro that would either let me insert the start date and the macro would run, print a page, then goto cell I1 and change the date to the next day of the month and would run until it reached an ending date. I cheated with a macro and like my answer to justahelper had to input all 31 days manually. Now I don't know a way to replace the "1/1/2004" to do the month of February, and so on. Any help is appreciated. "Ron de Bruin" wrote: Do you mean this ? If you fill in 3 it will print the sheet three times with another date Delete "preview:=True" if it is working corect Sub PrintCopies_ActiveSheet() Dim CopiesCount As Long Dim CopieNumber As Long Range("I1").Value = "1/1/2004" CopiesCount = Application.InputBox("How many Copies do you want", Type:=1) For CopieNumber = 1 To CopiesCount ActiveSheet.PrintOut preview:=True Range("I1").Value = Range("I1").Value + 1 Next CopieNumber End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to replace January (1) with February (2)
To use another macro how would that work with what I already have? "Ron de Bruin" wrote: Have you try the macro ? If you enter 30 it will print 30 pages with in the first 1/1/2004 the seconf 1/2/2004..... -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... no I just need 1 copy printed from each day in the entire year. The spreadsheet has been set up to insert a date into cell I1. This has to be done for each day separately. Bummer. What I wanted originally was to do this with some vba code or a macro that would either let me insert the start date and the macro would run, print a page, then goto cell I1 and change the date to the next day of the month and would run until it reached an ending date. I cheated with a macro and like my answer to justahelper had to input all 31 days manually. Now I don't know a way to replace the "1/1/2004" to do the month of February, and so on. Any help is appreciated. "Ron de Bruin" wrote: Do you mean this ? If you fill in 3 it will print the sheet three times with another date Delete "preview:=True" if it is working corect Sub PrintCopies_ActiveSheet() Dim CopiesCount As Long Dim CopieNumber As Long Range("I1").Value = "1/1/2004" CopiesCount = Application.InputBox("How many Copies do you want", Type:=1) For CopieNumber = 1 To CopiesCount ActiveSheet.PrintOut preview:=True Range("I1").Value = Range("I1").Value + 1 Next CopieNumber End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please explain exactly what you want to do
-- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I need to replace January (1) with February (2) To use another macro how would that work with what I already have? "Ron de Bruin" wrote: Have you try the macro ? If you enter 30 it will print 30 pages with in the first 1/1/2004 the seconf 1/2/2004..... -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... no I just need 1 copy printed from each day in the entire year. The spreadsheet has been set up to insert a date into cell I1. This has to be done for each day separately. Bummer. What I wanted originally was to do this with some vba code or a macro that would either let me insert the start date and the macro would run, print a page, then goto cell I1 and change the date to the next day of the month and would run until it reached an ending date. I cheated with a macro and like my answer to justahelper had to input all 31 days manually. Now I don't know a way to replace the "1/1/2004" to do the month of February, and so on. Any help is appreciated. "Ron de Bruin" wrote: Do you mean this ? If you fill in 3 it will print the sheet three times with another date Delete "preview:=True" if it is working corect Sub PrintCopies_ActiveSheet() Dim CopiesCount As Long Dim CopieNumber As Long Range("I1").Value = "1/1/2004" CopiesCount = Application.InputBox("How many Copies do you want", Type:=1) For CopieNumber = 1 To CopiesCount ActiveSheet.PrintOut preview:=True Range("I1").Value = Range("I1").Value + 1 Next CopieNumber End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "lschuh" wrote in message ... I can't get a reply to incrementing dates so I manually wrote a macro that would start with Jan 1 2004 then print, go to the next line of code Jan 2 2004 then print. I tried to add lines in between for dates Jan 3, Jan 4, etc. What is printing out is the first select and the last select. What is wrong with it. *I ' the lines out to see the code run but does not print out with the 'references removed Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/1/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Selection.PrintOut Copies:=1, Collate:=True Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/2/2004" Range("I2").Select Application.Goto Reference:="Print_Area" Range("I1:J1").Select ActiveCell.FormulaR1C1 = "1/3/2004" Range("I2").Select Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/4/2004" 'Range("I2").Select 'Application.Goto Reference:="Print_Area" 'Range("I1:J1").Select 'ActiveCell.FormulaR1C1 = "1/5/2004" 'Range("I2").Select Application.Goto Reference:="Print_Area" ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Changes/Prints Document Differently & it also Locks some Cel | Excel Discussion (Misc queries) | |||
Is there a way to default the number times a document prints? | Excel Discussion (Misc queries) | |||
In an excel document the info n row 2 prints out on both pages? He | Excel Discussion (Misc queries) | |||
A 2 line text showing up in the Cell in Excel prints in 1 line | Excel Discussion (Misc queries) | |||
document prints shifted to the right like it is right justified. | Excel Discussion (Misc queries) |