здравствуйте. не могли бы написать функцию, которая вернула бы адрес ячейки или номер столбца и строки по цвету ячейки. образец цвета в ячейке B2. извиняюсь за прямоту. этот форум не интересует.
Function АДРЕСЦВЕТ(iRng As Range, iClColor As Range)
Dim cl As Range, I&
Dim iArr$()
On Error Resume Next
ReDim iArr(0 To Application.Caller.Columns.Count)
For Each cl In iRng.Cells
If cl.Interior.Color = iClColor.Interior.Color Then
iArr(I) = cl.Address(0, 0)
I = I + 1
End If
Next
АДРЕСЦВЕТ = iArr
End Function
Function FindByColor(r As Range, c&)
Dim arr$(), cell As Range, i&
For Each cell In r.Cells
If cell.Interior.Color = c Then
If cell.MergeCells Then
If cell.Address = cell.MergeArea(1, 1).Address Then
ReDim Preserve arr(i)
arr(i) = cell.MergeArea.Address
i = i + 1
End If
Else
ReDim Preserve arr(i)
arr(i) = cell.Address
i = i + 1
End If
End If
Next
FindByColor = IIf(i, arr, [NA()])
End Function