Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro 2
Range("A2:D2").Select
Selection.Copy Sheets("Sheet2").Select Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=True Sheets("Sheet1").Select Range("A2" xlDropDown) If Cells (row_index, "A").Value < End Sub I know I need a bid more experience but learning as I go. I want to copy lines to a sheet, transposed, and print. Then the macro must go to the next line and do this again and stop at the last line. |
#2
|
|||
|
|||
Esrei,
Try this: Sub PrintTransposed() Sheets("Sheet2").Select Sheets("Sheet2").Range("B4").Select ' set printout location Sheets("Sheet1").Select Range("A2:D2").Select ' first row to process Do While ActiveCell < "" Selection.Copy Sheets("Sheet2").Select Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=True ActiveWindow.SelectedSheets.PrintPreview ' use for testing 'ActiveWindow.SelectedSheets.PrintOut ' use for real printing Sheets("Sheet1").Select ' back to sheet 1 Selection.Offset(1, 0).Select ' move down ' move selection down Loop End Sub It only looks at the cell in column A, and stops when it's empty. The Printout line is "remmed out" now. When it's working correctly with the PrintPreview, switch the apostrophe (') with the other line I would have recommended a more meaningful subject line for this post, like "Macro to print rows transposed." -- Earl Kiosterud mvpearl omitthisword at verizon period net ------------------------------------------- "Esrei" wrote in message ... Range("A2:D2").Select Selection.Copy Sheets("Sheet2").Select Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _ , Transpose:=True Sheets("Sheet1").Select Range("A2" xlDropDown) If Cells (row_index, "A").Value < End Sub I know I need a bid more experience but learning as I go. I want to copy lines to a sheet, transposed, and print. Then the macro must go to the next line and do this again and stop at the last line. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
Date macro | Excel Discussion (Misc queries) | |||
Help with macro formula and variable | Excel Worksheet Functions | |||
Macro and If Statement | Excel Discussion (Misc queries) |