Macros Compare the last two months and remove the coloring in the first

K0st4din

Active Member
Joined
Feb 8, 2012
Messages
358
Hello, everyone,
thanks to your help, so far I have been dealing with a lot of troublesome tasks for me.
I'm here again for your help.
I have a large database table.
With other macros, I get almost to the end of this table.
I have a dilemma with which I can not fight.
The table has a range of A2:AB - by the end.
In column "D" are the dates (day, month, year), in column "G" - are the numbers or names, in column "J" - there are codes.
I'm looking for a macro that can check for the last two months (regardless of who they are) to repeat the codes in "J", according to the numbers or names in "G" against the dates in column "D".
For example, if I compare the December 2018 and January 2019 and the same number in column "G" have the same codes in column "J", make (remove) the coloration and colorless the cell (in the example given in December 2018 ) - (we are talking about all comparisons in the table).
If this condition is repeated several months back, then leave colored "G" cells without changing anything in them.
Attach a pic, if you want an example table, I will attach.
I ask for your help because I review thousands of rows and spoil my eyes from watching in every single line.
If you have questions, please ask them to explain even more.
I thank everyone for your cooperation.
picture - https://drive.google.com/file/d/1UrNInwHJ9TaIeZJ_aJHHkQt7D4VJVs7a/view

https://drive.google.com/open?id=1UrNInwHJ9TaIeZJ_aJHHkQt7D4VJVs7a
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

K0st4din

Active Member
Joined
Feb 8, 2012
Messages
358
I tried to explain it a little more understandably
The structure is as follows:
there are three important columns:
Column "D" - months,
column "G" - the number
column "J" - codes
Looking macro that if a code column "J", under the same number of column "G", it has more than two months ago to stay colored numbers, but if, for example, in January 2019 ( "D") have number in the column "G" - 12345 and in February 2019 we have the same number in the column "G" - 12345, the number in January column "G" - to be made - No fill.
If, however, this column code "J", is repeated for more than two months (February, January, December, November, etc. column "D") and the number in column "G" is the same, not to change the pink color.
And so the check is going on, with information being superimposed next month
 

K0st4din

Active Member
Joined
Feb 8, 2012
Messages
358
Hello,
once there are no answers, there is obviously something that is not clear.
I really pray for some help.
If you have questions, please ask me.
I keep trying, but somehow I fail to count a specific number and the code for something, how many months I repeat. Somewhere I miss something, personally to me.
Thanks again to everyone.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,711
Messages
5,524,436
Members
409,577
Latest member
Dwg

This Week's Hot Topics

Top