Problems Programming a sort to move rows

J

Jordan

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
 
J

Jordan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top