Good Afternoon,
I have a macro that combines excel files into one. It works flawlessly, I just need it to "conditional format" as well, I thought that I had used the correct code but it doesn't seem to correct. The first screenshot is what the file looks like after it has been combined. Rows 7 & 8 contain the actual data that would need to turn red or green based on if it's out of tolerance. As you can see, I have my nominal tolerance, along with my upper and lower limit based on the plus and minus tolerances. If for example cell D7 is greater than or equal to D6 AND less than or equal to D5, then turn cell D7 green. I don't want to use the Range syntax, but the number of columns is never definite, it could/will change each time. The second screenshot is my code, I'm using the first for loop to count my columns, the second for loop to populate each upper and lower limit, and then the third for loop is my conditional formatting code. What route should I take for this to work correctly?
Thanks in advance!