+ Reply to Thread
Results 1 to 1 of 1

Counting and totals with formatting

  1. #1
    Registered User
    Join Date
    01-18-2006
    Posts
    11

    Counting and totals with formatting

    Need some help creating a macro (obviously why I'm here, right?)

    What I'm trying to do is the following, and I'm not very skilled with macros yet, but learning:

    Item 1: Check if the value of a cell is in any cell in the next 2 columns, if so, change the cell shading to yellow. Check if the value of a cell was in any cell in the previous 2 columns, if so, change the shading of the cell to green. Also, check to see if the value was used 10 times in the previous 20 columns, if so, change the shading to dark green.

    Idealy this would actually work in checking the only column 2 back from the given cell (x-2) and not both. However, the value of column (x-1) doesn't effect things much nor will it ever be the same, so using the previous 2 works.

    For the previous 20 columns, it would be (x-2,x-4,x-6..etc). Basiclly, there is a column between each of the ones I want to effect.

    Basiclly, if the same value is in any cell in a given row for 3 columns then it will be shaded (cell in column 1 will become yellow, cell in column 2 is uneffected, cell in column 3 becomes green, again, I am not concerned with what happens to the formatting in the 'filler' cells). And, if the value is found 10 times in a row (twenty columns counting the filler columns) the tenth entry becomes dark green (resulting in the first yellow, the next eight green and the tenth dark green (again dismissing the columns between)

    Item 2: This one should be easy. Check if a cell value is in an array of values, if so, change the shading (say, change all cells with a value of 1,2,5,7,8,10 and 23 red), . I'm still trying to figure out arrays with macros in excel

    Item 3: Count the number of previous columns a value was present and append that to the value

    Both these need to be able to be run against the entire worksheet, not just an individual cell.

    Gonna go back to hacking away on it myself, just hope maybe someone know already to save me a lot of time and frustration trying! Thanks.

    Sorry about the double post... had a burp in my connectivity.
    Last edited by rbmcc; 04-05-2006 at 02:50 PM.

+ 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