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: 208
Default VBA Program error...???

So I got this sort program below

sub srt()
r = 1
10 if cells(r,1) = "" and cells(r,2) = "" then goto 99
if cells(r,1)=cells(r,2) then r=r+1: goto 10
if cells(r,1)<cells(r,2) then
cells(r,2).select
Selection.Insert Shift:=xlDown
else
cells(r,1).select
Selection.Insert Shift:=xlDown
end if
r=r+1: goto 10
99
end sub

It works fine however I need it to assume there is a HEADER ROW and to move
cells 1-4 as a group and 5-8 as a group when cell 1 or 5 match or do not
match as the program runs. Also I need it to stop when it comes to the end.
Right now it continually runs the last item all the way to the bottom of the
sheet cell 64336 or something like that. Please help

Sample of what date looks like befo

HEADER HEADER
6905-323 EE-24 NIL -1 514-312 NIL EE-22 1
850CK-3 DD-05 NIL -1 514-322 NIL EE-23 1
BB709-D DD-13 NIL -1 811-01QFB NIL DD-14 1
CC7033 DD-00 NIL -1 811-01QHBNIL DD-14 1
CC7119 DD-00 NIL -1 850CK-3 NIL DD-03 1
CMC377 EE-07 NIL -1 850CK-3 NIL DD-04 1
CMC377 EE-07 NIL -1 B0081CK-1 NIL EE-20 1
CMC377 EE-07 NIL -1 BB709-D NIL DD-12 1
CMC377 EE-07 NIL -1 CC4584 NIL DD-15 1
CMC377 EE-07 NIL -1 CC7033 NIL DD-15 1
CMC377 EE-07 NIL -1 CC7119 NIL DD-15 1
FB3648-O EE-00 NIL -1 CMC394 NIL EE-07 1
FB3672-O EE-00 NIL -1 CMC394 NIL EE-07 1
FB3648-O NIL EE-19 1
FB3672-O NIL EE-19 1
FB3672-O NIL EE-19 1
FB3673-O NIL EE-19 1

Sample of what I WANT DATA to look like before.

HEADER HEADER
514-312 NIL EE-22 1
514-322 NIL EE-23 1
6905-323 EE-24 NIL -1 811-01QFB NIL DD-14 1
811-01QHBNIL DD-14 1
850CK-3 DD-05 NIL -1 850CK-3 NIL DD-03 1
850CK-3 NIL DD-04 1
B0081CK-1 NIL EE-20 1
BB709-D DD-13 NIL -1 BB709-D NIL DD-12 1
CC4584 NIL DD-15 1
CC7033 DD-00 NIL -1 CC7033 NIL DD-15 1
CC7119 DD-00 NIL -1 CC7119 NIL DD-15 1
CMC377 EE-07 NIL -1
CMC377 EE-07 NIL -1
CMC377 EE-07 NIL -1
CMC377 EE-07 NIL -1
CMC377 EE-07 NIL -1
CMC377 EE-07 NIL -1
CMC394 NIL EE-07 1
CMC394 NIL EE-07 1
FB3648-O EE-00 NIL -1 FB3648-O NIL EE-19 1
FB3672-O EE-00 NIL -1 FB3672-O NIL EE-19 1
FB3672-O NIL EE-19 1
FB3673-O NIL EE-19 1

Already have a process that SORTS it numeric to alphabetic just need to add
or change the current program to do the following. If anyone can help that
would be ideal. I also would like to color the discrepencies (Things that
dont match) in yellow.

Let me know if anyone has any great ideas or possibly a place where I can
learn how to better write these things myself...

Thanks

Sean


 
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
Program.xls cannot be found error R Weeden Excel Discussion (Misc queries) 13 May 2nd 23 03:43 AM
Excel Program Error Bishoy Excel Worksheet Functions 3 March 18th 07 05:35 PM
Excel Program Link Error? Neal Henzler Excel Discussion (Misc queries) 2 February 27th 06 05:22 PM
Copy/Paste program error Eager2Learn[_11_] Excel Programming 2 June 24th 04 05:21 AM


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

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

About Us

"It's about Microsoft Excel"