This code isn't doing what I need, either. I will try to explain again what I need.
If K2 is equal to AN2, copy AQ2:AS2 and paste it to AC2:AE2.
If K3 is equal to AN3, copy AQ3:AS3 and paste it to AC3:AE3.
If K4 is equal to AN4, copy AQ4:AS4 and paste it to AC4:AE4.
If K5 is equal to AN5, copy AQ5:AS5 and paste it to AC5:AE5.
...
If K1537 is equal to AN1537, copy AQ1537:AS1537 and paste it to AC1537:AE1537.
The first code you provided did the following:
</SPAN>
If K2 is equal to AN2, copy AQ2:AS2 and paste it to AC2:AE2.
(K2 is equal to AN2, so copy AQ2:AS2 and paste it to AC2:AE2).
(K3 is equal to K2, so skip)
(K4 is equal to K2, so skip)
...
(K27 is equal to AN27, so copy AQ27:AS27 and paste it to AC27:AE27)
(K28 is equal to K27, so skip)
(K29 is equal to K27, so skip)
...
This left me with only a couple of cells filled in, but at least they were correct.
The second code you provided me did the following:
If K98 is equal to AN98, copy AQ98:AS98 and paste it to AC98:AE98.</SPAN>
(K98 is equal to AN98, so copy AQ98:AS98 and paste it to AC98:AE98).</SPAN>
and then it pasted the same values down the entire table, filling in hundreds of cells with AQ98:AS98, and most of them were wrong.
I really do not understand why the first code pasted only once, then skipped all rows until it found a different value in K, pasted only once, skipped all rows until it found a different value in K, etc.