Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
I am trying to create a macro that will print out a row of information. This
macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
Hello Murph Try using this code Sub Print1() Range("A2:O3").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True End Sub Cheers -- robmeister ------------------------------------------------------------------------ robmeister's Profile: http://www.excelforum.com/member.php...o&userid=24364 View this thread: http://www.excelforum.com/showthread...hreadid=380230 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
In this solution the user will prompted for the row they wish to print.
Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 15 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B15").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: I am trying to create a macro that will print out a row of information. This macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
Ken this is perfect - thanks.
Follow up question - I only want up to row F to print in the group; so A:F and then row L:O to print can I eliminate the rows I do not want and maintain the same look? "Ken Hudson" wrote: In this solution the user will prompted for the row they wish to print. Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 15 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B15").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: I am trying to create a macro that will print out a row of information. This macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
Are you asking to print only columns A:F? If so, change:
For ILoop = 1 to 15 to For ILoop = 1 to 6 and change: Range("A1:B15").PrintOut Copies:=1, Collate:=True to Range("A1:B6").PrintOut Copies:=1, Collate:=True -- Ken Hudson "Murph" wrote: Ken this is perfect - thanks. Follow up question - I only want up to row F to print in the group; so A:F and then row L:O to print can I eliminate the rows I do not want and maintain the same look? "Ken Hudson" wrote: In this solution the user will prompted for the row they wish to print. Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 15 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B15").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: I am trying to create a macro that will print out a row of information. This macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
Thanks for the response -
I'm asking to print columns A:F and then columns L:O; skipping the information from G:K So I was wondering how to do that, "For ILoop = 1 to 6:12 to 15" ?? Thanks for your help I really appreciate it "Ken Hudson" wrote: Are you asking to print only columns A:F? If so, change: For ILoop = 1 to 15 to For ILoop = 1 to 6 and change: Range("A1:B15").PrintOut Copies:=1, Collate:=True to Range("A1:B6").PrintOut Copies:=1, Collate:=True -- Ken Hudson "Murph" wrote: Ken this is perfect - thanks. Follow up question - I only want up to row F to print in the group; so A:F and then row L:O to print can I eliminate the rows I do not want and maintain the same look? "Ken Hudson" wrote: In this solution the user will prompted for the row they wish to print. Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 15 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B15").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: I am trying to create a macro that will print out a row of information. This macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Print Macro..
Hi Murph,
We need to set up another loop to do that.... Option Explicit Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 6 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop For Iloop = 12 To 15 Cells(Iloop - 5, "A") = Cells(2, Iloop + 2) Cells(Iloop - 5, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B10").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: Thanks for the response - I'm asking to print columns A:F and then columns L:O; skipping the information from G:K So I was wondering how to do that, "For ILoop = 1 to 6:12 to 15" ?? Thanks for your help I really appreciate it "Ken Hudson" wrote: Are you asking to print only columns A:F? If so, change: For ILoop = 1 to 15 to For ILoop = 1 to 6 and change: Range("A1:B15").PrintOut Copies:=1, Collate:=True to Range("A1:B6").PrintOut Copies:=1, Collate:=True -- Ken Hudson "Murph" wrote: Ken this is perfect - thanks. Follow up question - I only want up to row F to print in the group; so A:F and then row L:O to print can I eliminate the rows I do not want and maintain the same look? "Ken Hudson" wrote: In this solution the user will prompted for the row they wish to print. Sub Transpose() Dim Ans As Integer Dim Iloop As Integer Application.ScreenUpdating = False Ans = InputBox("Enter row number to print.") Columns("A:B").Insert For Iloop = 1 To 15 Cells(Iloop, "A") = Cells(2, Iloop + 2) Cells(Iloop, "B") = Cells(Ans, Iloop + 2) Next Iloop Range("A1:B15").PrintOut Copies:=1, Collate:=True Columns("A:B").Delete Application.ScreenUpdating = False End Sub -- Ken Hudson "Murph" wrote: I am trying to create a macro that will print out a row of information. This macro will be embedded into an autoshape at the end of each row. The Column Titles are in Row 2 from A2:O2 The information that I would like to print out is in A3:O3 The print would have the column title followed by the information from the cell below it. (i.e.: A2 with A3's info to the right of the title, B2 with B3's info to the right of it, etc. etc. up to O2 and O3) The macro would grab the column titles and the information from the assigned row and print out to the default printer. in Cell P3 I have placed the clickable autoshape for the macro to be embedded into. I want to use this macro in every row there after still keeping Row A2:O2 as the titles. Is this possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Macro to open print window and set to print entire workbook | Excel Discussion (Misc queries) | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
Why does macro speed slow after Excel Print or Print Preview? | Excel Programming | |||
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook | Excel Programming |