Could have been more efficient without selections or incrementing i as in my offering I previously sent

Option Explicit
Sub transposerows()
Dim i As Long
For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row Step 3
Cells(i, 1).Resize(3).Copy
Cells(i, 2).PasteSpecial Transpose:=True
Next i
Columns(2).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Columns(1).Delete
End Sub

-----Original Message----- From: GreenBriar
Sent: Friday, August 26, 2011 12:59 PM
To: MS EXCEL AND VBA MACROS
Subject: Re: $$Excel-Macros$$ Re: Cut Data from Rows and Paste into Columns

This worked like a charm. Thank you.

On Aug 26, 6:53 am, ashish koul <[email protected]> wrote:
Sub test()
Dim i, interval, j As Long
interval = 3
j = 2
For i = 1 To Sheets(1).Range("a1").End(xlDown).Row

Sheets(1).Range("A" & i & ":A" & i + interval - 1).Copy

    Range("D" & j).Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
        False, Transpose:=True

i = i + interval - 1
j = j + 1
Next

End Sub

On Fri, Aug 26, 2011 at 7:15 PM, GreenBriar <[email protected]>wrote:



> 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 athttp://www.excel-macros.blogspot.com
> 4. Learn VBA Macros athttp://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks athttp://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

--
*Regards*
* *
*Ashish Koul*
*akoul*.*blogspot*.com <http://akoul.blogspot.com/>http://akoul.posterous.com/
*akoul*.wordpress.com <http://akoul.wordpress.com/>
My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>

P Before printing, think about the environment.

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

Reply via email to