Solved: Excel macro to loop through rows, while looping format rows if meet criteria
I'm having difficulty writing a macro to execute how I would like. I wish to search through all rows of a spreadsheet, if a particular column of the row contains matching text, then format the entire row as I would like (text color, borders, bold, etc..)
My current code only applies the formatting to the column with the matching text. See below:
[VBA] Sub practice()
'loop for formatting subtotaled rows
Cells.Select
For Each mycell In Selection
If mycell.Value Like "*CO*" Then
Range(Selection, Selection.End(xlToRight)).Select
myrange.Font.Bold = True
myrange.Interior.ColorIndex = 35
End If
Next
End Sub[/VBA]
Conditional Formatting multiple conditions
Thanks very much, but I'm trying to avoid or minimize calcultion with defined ranges in my sheets(= too large), it takes to much time to calculate the result.
I attached a file to demonstrate my problem with a pivot table.
I need 4 or more conditions to fill the subtotals and grand total with colors using conditional formatting with a formula in my pivot table. Every time the pivot table changes, the colors are following the movement. But I can not go further than 3 conditions.
Regards
Oliver