Macro 2

  • Thread starter Thread starter Esrei
  • Start date Start date
E

Esrei

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.
 
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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top