+ Reply to Thread
Results 1 to 3 of 3

Quite simple macro, but I can't seem to fix it...

  1. #1
    rantz
    Guest

    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 (A1>B1) 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!


  2. #2
    Registered User
    Join Date
    02-13-2006
    Posts
    46
    u mean the insertion of row should start at row 9 and next at row 10? This clarification will help in writing the code for the same.
    Regards,
    Ashish

  3. #3
    rantz
    Guest

    Re: Quite simple macro, but I can't seem to fix it...

    Thank you for taking interest in my problem.

    My first idea was to insert at row 9 and then the rest of the
    (previously) moved rows will be pushed down. This however is not
    important. The order of the moved rows that is.

    But maybe there will be a problem with the compairing loop if the macro
    keeps adding rows on top of the list. (se link to pic below)

    So the answer to your question:

    If you don't think putting extra rows above the list we compair will
    mess the loop up this would be best.

    Otherwise begin at 9 and out the rest at 10, 11 etc

    See link to example pic below

    http://342341.istheshit.net/

    And again, thank you!!



    ashishprem skrev:

    > u mean the insertion of row should start at row 9 and next at row 10?
    > This clarification will help in writing the code for the same.
    > Regards,
    > Ashish
    >
    >
    > --
    > ashishprem
    > ------------------------------------------------------------------------
    > ashishprem's Profile: http://www.excelforum.com/member.php...o&userid=31485
    > View this thread: http://www.excelforum.com/showthread...hreadid=550345



+ 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