Results 1 to 5 of 5

Programming a Macro to select row ranges based on a formula

Threaded View

workaholic Programming a Macro to select... 05-02-2009, 11:08 PM
stanleydgromjr Re: Programming a Macro to... 05-02-2009, 11:31 PM
workaholic Re: Programming a Macro to... 05-03-2009, 12:41 AM
stanleydgromjr Re: Programming a Macro to... 05-03-2009, 04:12 PM
workaholic Re: Programming a Macro to... 05-03-2009, 09:32 PM
  1. #1
    Registered User
    Join Date
    05-02-2009
    Location
    NYC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Programming a Macro to select row ranges based on a formula

    Hi everyone,

    I feel like this is a rather newbie question, but my googling efforts haven't unearthed an answer. I'm building a macro thats copying 4 rows of data at a time from a spreadsheet (has 1500 rows of data total) and transposing it to a master spread sheet.

    There are blank rows in between each entry (the data source I'm using isn't clean), so how can I either have the macro jump to the first row it finds with a value, copy rows until it stops finding a value, paste+transpose into a new document and then repeat the process throughout the document.

    If thats too complicated, a macro that finds rows based on a formula would work as well. E.g. Start at row 5, copy+paste+transpose 5-8, start at row 11 (5+6), copy + paste+transpose 11-14, start at row 17 (x+6) ...etc...

    Here's the code I have developed thus far:
        Do Until Cells(intCurrentRow, 1).Value = ""
        Range("A7:A10").Select
        Selection.Copy
        Windows("Book2").Activate
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Windows("Book1").Activate
        Range("A13:A16").Select
        Application.CutCopyMode = False
        Selection.Copy
        Windows("Book2").Activate
        Range("A4").Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
    Attached Files Attached Files
    Last edited by workaholic; 05-07-2009 at 04:14 PM.

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