ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting and totals with formatting (https://www.excelbanter.com/excel-programming/358122-counting-totals-formatting.html)

rbmcc

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. I'm still trying to figure out
arrays with macros in excel :(

Both these need to be able to be run against the entire worksheet, not
just an individule 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


--
rbmcc
------------------------------------------------------------------------
rbmcc's Profile: http://www.excelforum.com/member.php...o&userid=30602
View this thread: http://www.excelforum.com/showthread...hreadid=530176



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com