Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default How to Create Macro to Increase Cell Value to one and Print Worksheet

We are trying to automate the printing of a worksheet. In sheet
"Jobs" of the workbook it has consecutive numbers in column A (1,
2,3 ...) and is variable. We would like to automate the insertion of
each consecutive number from this column A into cell C6 of the Summary
sheet, and print out the Summary sheet, until the last number is
reached in column A.

Example: Column A has numbers 1-32. The macro will copy 32 times
(numbers 1 through 32) into cell C6 and each time print the Summary
sheet out. (by copying the number into C6 it will activate other
formulas...)

Thanks so much for anyone who can assist!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default How to Create Macro to Increase Cell Value to one and Print Worksh

Sub printum()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Jobs")
Set s2 = Sheets("Summary")
n = s1.Cells(Rows.Count, "A").End(xlUp).Row
s2.Activate
For i = 1 To n
s2.Range("C6").Value = s1.Cells(i, "A").Value
Application.Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
--
Gary''s Student - gsnu2007j


" wrote:

We are trying to automate the printing of a worksheet. In sheet
"Jobs" of the workbook it has consecutive numbers in column A (1,
2,3 ...) and is variable. We would like to automate the insertion of
each consecutive number from this column A into cell C6 of the Summary
sheet, and print out the Summary sheet, until the last number is
reached in column A.

Example: Column A has numbers 1-32. The macro will copy 32 times
(numbers 1 through 32) into cell C6 and each time print the Summary
sheet out. (by copying the number into C6 it will activate other
formulas...)

Thanks so much for anyone who can assist!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default How to Create Macro to Increase Cell Value to one and PrintWorksh

On Jul 23, 11:50 am, Gary''s Student
wrote:
Sub printum()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Jobs")
Set s2 = Sheets("Summary")
n = s1.Cells(Rows.Count, "A").End(xlUp).Row
s2.Activate
For i = 1 To n
s2.Range("C6").Value = s1.Cells(i, "A").Value
Application.Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
--
Gary''s Student - gsnu2007j

" wrote:
We are trying to automate the printing of a worksheet. In sheet
"Jobs" of the workbook it has consecutive numbers in column A (1,
2,3 ...) and is variable. We would like to automate the insertion of
each consecutive number from this column A into cell C6 of the Summary
sheet, and print out the Summary sheet, until the last number is
reached in column A.


Example: Column A has numbers 1-32. The macro will copy 32 times
(numbers 1 through 32) into cell C6 and each time print the Summary
sheet out. (by copying the number into C6 it will activate other
formulas...)


Thanks so much for anyone who can assist!


Gary, thank you so much!! What if we what to modify the formula to
account for a slightly different name than "Jobs" for the Jobs sheet;
sometimes it contains an additional code i.e. "Jobs 34-08".
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default How to Create Macro to Increase Cell Value to one and Print Wo

just change the line:

Set s1 = Sheets("Jobs")

into:

Set s1 = Sheets("Jobs 34-08")

or whatever the tab name happens to be.
--
Gary''s Student - gsnu2007j


" wrote:

On Jul 23, 11:50 am, Gary''s Student
wrote:
Sub printum()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Jobs")
Set s2 = Sheets("Summary")
n = s1.Cells(Rows.Count, "A").End(xlUp).Row
s2.Activate
For i = 1 To n
s2.Range("C6").Value = s1.Cells(i, "A").Value
Application.Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
--
Gary''s Student - gsnu2007j

" wrote:
We are trying to automate the printing of a worksheet. In sheet
"Jobs" of the workbook it has consecutive numbers in column A (1,
2,3 ...) and is variable. We would like to automate the insertion of
each consecutive number from this column A into cell C6 of the Summary
sheet, and print out the Summary sheet, until the last number is
reached in column A.


Example: Column A has numbers 1-32. The macro will copy 32 times
(numbers 1 through 32) into cell C6 and each time print the Summary
sheet out. (by copying the number into C6 it will activate other
formulas...)


Thanks so much for anyone who can assist!


Gary, thank you so much!! What if we what to modify the formula to
account for a slightly different name than "Jobs" for the Jobs sheet;
sometimes it contains an additional code i.e. "Jobs 34-08".

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default How to Create Macro to Increase Cell Value to one and Print Wo

On Jul 24, 1:18 pm, Gary''s Student
wrote:
just change the line:

Set s1 = Sheets("Jobs")

into:

Set s1 = Sheets("Jobs 34-08")

or whatever the tab name happens to be.
--
Gary''s Student - gsnu2007j

" wrote:
On Jul 23, 11:50 am, Gary''s Student
wrote:
Sub printum()
Dim s1 As Worksheet, s2 As Worksheet
Set s1 = Sheets("Jobs")
Set s2 = Sheets("Summary")
n = s1.Cells(Rows.Count, "A").End(xlUp).Row
s2.Activate
For i = 1 To n
s2.Range("C6").Value = s1.Cells(i, "A").Value
Application.Calculate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Next
End Sub
--
Gary''s Student - gsnu2007j


" wrote:
We are trying to automate the printing of a worksheet. In sheet
"Jobs" of the workbook it has consecutive numbers in column A (1,
2,3 ...) and is variable. We would like to automate the insertion of
each consecutive number from this column A into cell C6 of the Summary
sheet, and print out the Summary sheet, until the last number is
reached in column A.


Example: Column A has numbers 1-32. The macro will copy 32 times
(numbers 1 through 32) into cell C6 and each time print the Summary
sheet out. (by copying the number into C6 it will activate other
formulas...)


Thanks so much for anyone who can assist!


Gary, thank you so much!! What if we what to modify the formula to
account for a slightly different name than "Jobs" for the Jobs sheet;
sometimes it contains an additional code i.e. "Jobs 34-08".


Gary,
Thanks for your quick response. I am sorry I may have been not
totally clear. The tab name may change from day to day - so we are
looking for a formula to account for that. The word "jobs" will
always be part of the name though. Is it possible to include this as
a string? Or: there are only two tabs, the first one containing the
"Jobs" name, and the second one is always the same.
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
In excel how do I increase a number in a cell by 1 after I print? mjtaxpro New Users to Excel 4 July 26th 07 11:36 PM
create up and down arrows to increase and decrease value in a cell Bill Excel Worksheet Functions 1 June 13th 07 09:18 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM


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