LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort rows and move borders with rows [email protected] New Users to Excel 1 June 4th 09 07:36 AM
Can I link/lock rows so they move together in a sort? dla80 Excel Worksheet Functions 1 January 21st 08 03:02 PM
sort rows in alphabetical order and move the corresponding data lianeanddave Excel Worksheet Functions 3 August 26th 05 04:43 PM
Problems programming to the registry using RegEnumKey Simon Livings via OfficeKB.com Excel Programming 1 April 18th 05 11:32 AM
Problems programming to the registry using RegEnumKey Simon Livings via OfficeKB.com Excel Programming 0 April 18th 05 11:10 AM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"