Hi,
I’m trying to go through a number of Excel files, and update conditional formatting of certain cells given some conditions.
I’ve looked through the example code on the sample site and I’m not sure if this can be done.
Below is some VBA code that achieves the same thing, however I don’t want to undertake automation and prefer to use Aspose.
Sub Macro1()
For Each Sheet In ActiveWorkbook.Sheets
If Sheet.Visible = True Then
Sheet.Select
Cells.Select
For Each FormatCondition In Selection.FormatConditions
With FormatCondition
If .Type = xlCellValue Then
If .Formula1 = "=0.495" Then
If .Formula2 = "=0.00001" Then
.Modify xlCellValue, xlBetween, "=0.00001", "=0.495"
End If
End If
End If
End With
Next
End If
Next
End Sub