Results 1 to 7 of 7

Thread: Loop through multiple columns and rows at once.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Aug 2011
    Posts
    17
    Location

    Unhappy Loop through multiple columns and rows at once.

    Hello Everyone

    Being a newbie has it's frustrating moments . I've been at my system all day trying to work my way around what should normally be a simple thing to solve if i knew what i was doing, sadly, I don't!

    I've been working on a document and wondered if anyone could help with a loop statement to run through multiple rows and columns.I have attached an excel document for this.

    Here's what i'd like my code to do;

    >> compare values in the unshaded rows with values in the shaded rows for each column. That is, compare values in D2 with D3. . . J2 with J3. . .P2 with P3. . . V2 with V3. . . .etc till the last value in the unshaded row, in this case, till AB2

    >>>> I'd like this to be repeated for each unshaded row, and skipping the shaded rows. Therefore, in this case, the next iteration will compare D4 with D5. . .J4 with J5. . . and will continue this till AH4 is compared with AH5


    >>>>> For each comparison, what i intend to do is;

    ** if D2 < D3, and J2 < J3, and P2 < P3 and V2 < V3, and AB2<AB3, highlight the unshaded row with a certain color.

    **If not, then if D2<D3 and J2<J3 and P2 < P3 and V2 < V3, highlight the unshaded row with a certain color.

    ** if not, then if D2<D3 and J2<J3 and P2<P3, highlight the unshaded row with a certain color

    ** if not, then if D2<D3 and J2<J3, highlight the unshaded row with a certain color.

    ** if not, then if D2<D3, highlight the unshaded row with a certain color

    >>> if not, then go to the next unshaded row, i.e D4

    I would be eternally grateful if you could include a code that is easy for a beginner to grasp, and even more grateful if you include points on how the code does what it does.

    Kindly help
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •