Results 1 to 3 of 3

Help with looping a macro

Threaded View

  1. #1
    Registered User
    Join Date
    11-21-2012
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with looping a macro

    Hi,

    New to all of this (as in first day!) and I've managed to cobble a couple of macros together to format a worksheet but I need help with this one in particular.

    What I have so far is what I've recorded myself. I'm trying to copy a selection of cells from a row and transpose them into a (pre-existing) column. What I need to have happen is for this macro to repeat down the page until there are no more rows to transpose.

    Each row has unique data so I am not looking to repeat a single row down the page. Each row I am transposing exists from columns E:Q. Each row will transpose into column D. Also, each row with data that I am transposing has 12 blank rows between it (in order to fit the row turned column).

    So it should select, transpose, delete, skip 12 rows, select, transpose, delete, skip 12 rows, etc. Here is the code I have so far and a before and after screen shot. Thanks for any help.

    Sub transpose_qty()
    ' transpose_qty Macro
    Range("E2:Q2").Select
    Selection.Copy
    Range("D2").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=True
    Range("E2:Q2").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    End Sub
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1