Hello all,
Need a little help converting this IF statement in VB to a loop:
A2 B2 C2 D2 E2 F2 G2![]()
If Range("A4") = Range("A3") And Range("B4") = Range("B3") And Range("C4") = Range("C3") And Range("E4") = Range("E3") And Range("F4") = Range("F3") And Range("G4") = Range("G3") Then Range("D3") = Range("D3") & Range("D4") Range("A4:G4").Font.ColorIndex = 50 End If If Range("A3") = Range("A2") And Range("B3") = Range("B2") And Range("C3") = Range("C2") And Range("E3") = Range("E2") And Range("F3") = Range("F2") And Range("G3") = Range("G2") Then Range("D2") = Range("D2") & Range("D3") Range("A3:G3").Font.ColorIndex = 50 End If
A3 B3 C3 D3 E3 F3 G3
becomes:
A2 B2 C2 D2D3 E2 F2 G2
A3 B3 C3 D3 E3 F3 G3
Basically, the macro goes through each row and the row below it. If col A, B, C and E, F, G match, then it combines the contents of col D, then highlights the row below it (marked as a duplicate).
I am 1) trying to write this into a loop to go through as many as 3000 rows and 2) simply the IF statement when possible.
Any help on this would be greatly appreciated! Thanks!
Bookmarks