Macro to copy data frow rows to one column

N

N! Xau

With this macro I try to copy data in columns B:M (12 months) and rows
3:8 (6 years)
into one column only, to then make a 1-serie graph. Data sample could
be this group archive, at the bottom of page:
http://groups.google.it/group/microsoft.public.excel/about
But I get errors.

Thanks for help.


DestinationRowID = 10

For RowID = 3 To 8

For ColID = B To M
Range((ColID) + CStr(RowID)).Select
Selection.Copy
Range("B" + CStr(DestinationRowID + 1)).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Next

Next
 
D

Dave Peterson

One way (I think):

Option Explicit
Sub testme()

Dim DestCell As Range
Dim RngToCopy As Range
Dim myCol As Range

With ActiveSheet
Set RngToCopy = .Range("B3:M8")
Set DestCell = .Range("B11")

For Each myCol In RngToCopy.Columns
myCol.Copy _
Destination:=DestCell
Set DestCell = DestCell.Offset(myCol.Cells.Count)
Next myCol
End With
End Sub
 
Top