R
rbelforti
I'm trying to automate the following code into a do while loop or for
loop but cannot figure out how to reference a range with variables
instead of the exact cell names.
I want to take Range("B2:M2"), Range("B6:M6")., Range("B10:M10"),
Range("B14:M14") etc and copy them to one large column on another
sheet. (the column should grow by a factor of 12 rows each time.)
Please give some advice on how to use a loop to automate the following
code:
I recorded the Macro called "Transpose"
Sub Transpose()
'
' Transpose Macro
' Macro recorded 6/24/2004 by Robert Belforti
'
'
Range("B2:M2").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
Sheets("Sheet2").Select
'
Range("B6:M6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B14").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
Sheets("Sheet2").Select
'
Range("B10:M10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B26").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
End Sub
Attachment filename: bowling_chart_test.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=592563
loop but cannot figure out how to reference a range with variables
instead of the exact cell names.
I want to take Range("B2:M2"), Range("B6:M6")., Range("B10:M10"),
Range("B14:M14") etc and copy them to one large column on another
sheet. (the column should grow by a factor of 12 rows each time.)
Please give some advice on how to use a loop to automate the following
code:
I recorded the Macro called "Transpose"
Sub Transpose()
'
' Transpose Macro
' Macro recorded 6/24/2004 by Robert Belforti
'
'
Range("B2:M2").Select
Selection.Copy
Sheets("Sheet1").Select
Range("B2").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
Sheets("Sheet2").Select
'
Range("B6:M6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B14").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
Sheets("Sheet2").Select
'
Range("B10:M10").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("B26").Select
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=True
End Sub
Attachment filename: bowling_chart_test.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=592563