View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
rantz rantz is offline
external usenet poster
 
Posts: 6
Default Quite simple macro, but I can't seem to fix it...

I have a simple task that I want to write a macro for but I can't
seem to make it work.

I have two columns (A and B) like this.

A B
1 Estimated fall out
2 9000 5885
3 8000 8115
4 6500 8698

I want to compare the value on every row and do different things with
each row depending on their relation.

IF (A1B1) THEN

CUT ENTIRE ROW AND INSERT AT ROW 9

IF (ABS(A1-B1) < 100) THEN

DELETE ROW

ELSE

GOTO NEXT ROW UNTIL BLANK

I hope you get the pseudo. I guess a loop would be in order. Something
like this perhaps.

X=2
Do until Cells(x, 1).Value = ""
VBA-CODE..
X=X+1
Loop

Would be very grateful for any help!