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
它看起來像什麼範圍內被發現,但也有一幫在第一列。