Если вы используете Range.Find
с SearchFormat
, это может выглядеть примерно так:
Sub Macro1()
Application.FindFormat.Clear
Application.FindFormat.Font.Size = 20
Dim ws As Worksheet
Set ws = ActiveSheet
Dim foundCell As Range
Set foundCell = ws.Range("A:A").Find(What:="", _
After:=ws.Cells(ws.Rows.Count, 1), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=True)
If Not foundCell Is Nothing Then
Debug.Print foundCell.Address '<- foundCell is the one you want
End If
End Sub
Если вам нужен обычный цикл For
:
Dim ws as Worksheet
Set ws = ActiveSheet
Dim lastRow as Long
lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
Dim i as Long
For i = 1 to lastRow
If ws.Cells(i, 1).Font.Size = 20 Then
Exit For '<- Cells(i, 1) is the one you want
End IF
Next i