I'm looking for away to delete rows without it affecting my conditional formatting ranges that I've applied to my worksheet. I want my CF ranges to stay the same (ex. $A$1:$A$5000) but whenever my code deletes a row, the second number (5000) is reduced by one, when I want it to stay the same. Is there anyway I can delete my rows without it affecting the CF?
I also know that I could just apply conditional formatting to the worksheet with a dynamic range each time I run the macro, but I'd rather not go through the hassle of rewriting ~20 CF scenarios into VBA for this macro if I can just avoid it changing all together. Here is my loop which steps through the rows and deletes them if it meets the criteria:
ActiveWorkbook.Worksheets("Master Sheet").Activate
Last = Cells(Rows.Count, "R").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "R").Value) = "Business" Then
Cells(i, "A").EntireRow.Delete
End If
Next I
I've thought that an alternative solution would be to add a simple loop to cycle through all my CFs that are set up and drag them down to the lastrow. Would this be a viable alternative?
$A$1:$A$5000
=INDEX($A:$A,1):INDEX($A:$A,5000)
- Scott CranerRange("A:A")
as that will apply to the entire column. - braX$A$4:$A
as an option - dwirony$A$2:$A$1048576
and it stays like that just fine. - dwirony