Moving data from multiple columns
In what order do you the data to appear?
One long column with 140 rows?
Row1 to A1:A7 then row2 to A8:A14
Sub c()
Dim rngIn As Range, rngOut As Range, i As Long
Set rngIn = Range("A1:G20")
Set rngOut = Range("H1")
For i = 1 To rngIn.Rows.Count
rngIn.Rows(i).Copy
rngOut(1 + (rngIn.Columns.Count) * (i - 1)).PasteSpecial _
Transpose:=True
Next
Application.CutCopyMode = False
Columns("A:G").EntireColumn.Delete
Range("A1").Select
End Sub
Gord Dibben Excel MVP
On Tue, 30 Nov 2004 09:19:04 -0800, "cdwa"
wrote:
I am not a programmer so please bear with me as I learn VBA.
I am trying to bring data scattered across 7 columns (b,c,d,e,f,g,h) into
column( a).
How would I do this. I know that I need to test for the precense of data in
the column, select it and move it, then move to the next row.
Can I use something like;
For i = 1 to 20 ' number of rows
Select Case Data
Case Column 1
range.offset (0,1)= range.offset(i,1)
etc.
End Select
Next i
Thanks
|