+ Reply to Thread
Results 1 to 2 of 2

Snake columns according to cell value instead of row number

  1. #1
    Registered User
    Join Date
    06-27-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    3

    Snake columns according to cell value instead of row number

    I found this code that snakes 2 columns, it works very well, but it cuts the column at the row number 50. Instead I need it to be cut by the cell value of the 2nd column instead (values range from 0100-0499), such as: 0100-0199, 0200 to 0299, 0300 to 0399, and 0400 to 0499, INSTEAD of row "50". this will end up being two pages, 4 columns total, 2 columns per page. 0100-0299 on one page, and 0300-0499 on the second page.

    The values are numeric in the second column with a number format of "0000". Any ideas how to edit this?
    Sub SortAndSuch()

    Sub Move_Sets()
    Dim iSource As Long
    Dim iTarget As Long

    iSource = 2
    iTarget = 2
    Range("A1:C1").Copy Range("D1:F1")
    Do
    Cells(iSource, "A").Resize(50, 2).Cut _
    Destination:=Cells(iTarget, "A")
    Cells(iSource + 50, "A").Resize(50, 2).Cut _
    Destination:=Cells(iTarget, "D")
    Cells(iSource + 108, "A").Resize(50, 2).Cut _
    Destination:=Cells(iTarget, "F")
    Cells(iSource + 162, "A").Resize(50, 2).Cut _
    Destination:=Cells(iTarget, "H")
    iSource = iSource + 216
    iTarget = iTarget + 51 'insert a blank row

    Loop Until IsEmpty(Cells(iSource, "A").Value)

    End Sub

  2. #2
    Registered User
    Join Date
    06-27-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Snake columns according to cell value instead of row number

    anyone out there?

+ Reply to Thread

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