Try this
Option Base 1
Sub DoSomething()
Dim SrcRng As Range
Dim OptRng As Range
Dim arr() As Variant
Dim r As Integer
Dim c As Integer
Dim k As Integer
Set SrcRng = Application.InputBox("Please Select the Source Range", , ,
, , , , 8)
Set OptRng = Application.InputBox("Please Select the OutPut Cell", , , ,
, , , 8)
r = (SrcRng.Rows.Count / 3) + 1
c = 3
ReDim arr(r, c)
k = 1
For i = 1 To r
For j = 1 To c
arr(i, j) = SrcRng.Cells(k, 1).Value
k = k + 1
Next
Next
OptRng.Resize(r, c).Select
Selection.Value = arr
End Sub
From: [email protected] [mailto:[email protected]]
On Behalf Of GreenBriar
Sent: Friday, August 26, 2011 7:16 PM
To: [email protected]
Subject: $$Excel-Macros$$ Re: Cut Data from Rows and Paste into Columns
Transpose would not work because every 4th record (or row) would need to go
back to the first column, next row.
original data could be in either an excel spreadsheet or a text file,
whichever works best.
thus
1
2
3
4
5
6
7
8
9
would look like
1 2 3
4 5 6
7 8 9
--
----------------------------------------------------------------------------
------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
To post to this group, send email to [email protected]
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel
--
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links :
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
To post to this group, send email to [email protected]
<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel