Hi Everyone,
I am currently working with a macro that goes through a master spreadsheet and parses the information into much smaller/more targeted categories based off certain criteria. I've gotten the macro to copy and paste everything correctly but the problem is the formatting.
On my master spreadsheet, I have conditional formatting to color certain cells. When I run my macro, it copies the conditional formatting and creates format errors on the other sheet. Is there anyway I can amend my macro to prevent the conditional formatting from copying over?
Sub CopyRowsToStatusReport()
Dim i As Integer
Dim ws1 As Worksheet: Set ws1 = ThisWorkbook.Sheets("Master")
Dim ws2 As Worksheet: Set ws2 = ThisWorkbook.Sheets("Status Report")
For i = 2 To ws1.Range("B65536").End(xlUp).Row
If (ws1.Cells(i, 2) = "B" Or ws1.Cells(i, 2) = "A") And ws1.Cells(i, 16).Value <= 1 Then
Set rngCopy = Union(Range("A" & i), Range("C" & i), Range("E" & i & ":" & "F" & i), Range("H" & i & ":" & "I" & i), Range("K" & i & ":" & "J" & i), Range("N" & i & ":" & "O" & i))
rngCopy.Copy ws2.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
Next i
End Sub
Bookmarks