0
我正试图在Excel宏中查找并删除包含粗体斜体(即标题)的所有行。在VBA for Excel中查找所有粗体斜体
这是我有:
Sub CLEARHEAD()
With Application.FindFormat.Font
.Bold = True
.Italic = True
End With
x = ActiveSheet.UsedRange.Rows.Count
With Range(Cells(1, 1), Cells(x, 1))
Set i = .Find(What:="*", SearchFormat:=True)
If Not i Is Nothing Then
firstAddress = i.Address
Do
i.EntireRow.Delete
Set i = .FindNext(i)
Loop While Not i Is Nothing And i.Address <> firstAddress
End If
End With
End Sub
它看起来像什么范围内被发现,但也有一帮在第一列。