"I want to find which cells are colored in a certain way."
in VBA, you can start a quick procedure using the Find method, which searches by format. For example, to find all cells with the same cell font color and interior color as a cell in A1. I suppose you can use something like this in VSTO
Sub FindFormat() Dim rng1 As Range Dim rng2 As Range Dim strAddress As String With Application.FindFormat .Interior.ColorIndex = [a1].Interior.ColorIndex .Font.Color = [a1].Font.Color End With Set rng1 = Cells.Find("", [a1], xlFormulas, , , , , , True) If Not rng1 Is Nothing Then strAddress = rng1.Address Set rng2 = rng1 Do Set rng1 = Cells.Find("", rng1, xlFormulas, , , , , , True) Set rng2 = Union(rng1, rng2) Loop While rng1.Address <> strAddress MsgBox "Range similar format to A1 is " & rng2.Address End If End Sub

brettdj
source share