+ Reply to Thread
Results 1 to 2 of 2

Problems Programming a sort to move rows

  1. #1
    Jordan
    Guest

    Problems Programming a sort to move rows

    Hi all,
    I have posted before and you have been of great help. I am
    relatively new at programming and working to piece together a program
    to sort through a very large database. Based on one cells value being
    even or odd, I need to then move that entire row to another worksheet.
    Here is my programming, thanks for your time:

    Sub WIDSSORT()
    Worksheets("Sheet2").Activate
    For Each c In Worksheets("Sheet2").Range("E2:E11450").Cells
    If c.Value / 2 Mod 0 = 1 Then
    GoTo moveroweven
    Else:
    GoTo moverowodd
    End If
    Next
    On Error Resume Next
    moveroweven:
    good = Rows.Active
    Rows(good).Cut
    Sheet57.Activate
    rowtomoveto = Str(Trim(Sheet57.UsedRange.Rows.Count + 1))
    Rows(rowtomoveto).Select
    ActiveSheet.Paste

    moverowodd:
    good = Rows.Active
    Rows(good).Cut
    Sheet3.Activate
    rowtomoveto = Str(Trim(Sheet3.UsedRange.Rows.Count + 1))
    Rows(rowtomoveto).Select
    ActiveSheet.Paste

    End Sub


  2. #2
    Jordan
    Guest

    Re: Problems Programming a sort to move rows

    I apolagize, I forgot to mention that I am getting alot of problems
    with this code, initially a subscript our of range error. Any help I
    can get would be great, thanks.


+ 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