I need a loop that will match and select different columns (not in sequential order) and paste them to another sheet all whilst keeping the condition in check. It would also be ideal if when the values get pasted that the formatting for the cell is not carried over, just the value.
Below is the code I am currently using:
Sub Test() Application.ScreenUpdating = False Sheets("DATA").Select lr = Range("B" & Rows.Count).End(xlUp).Row Range("P3").Select For i = 3 To lr If Cells(i, 2) <> "" Then Range(Cells(i, 7), Cells(i, 16), Cells(i, 26)).Copy Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) Next Application.ScreenUpdating = True End Sub The problem is declaring the columns I want the loop to paste. I need the loop to run through the 16th column, check empty values, and then paste the index/matched value in the rows of columns 7,16,and 26 (so not in sequential order).. Any help would be appreciated.
