| 
    
     |  | ▼はってんちゅう さん: 
 ↑ で EntireRowと書きましたが列削除でしたね。 EntireColumn。
 以下に改訂コード案をアップします。
 
 直接本円のテーマというわけではないのですが
 Loop While Not cNo Is Nothing And cNo.Address <> firstAddress
 VBAのヘルプにも記載されている「有名な?」コードですけど、
 これは、実は「有名なバグ」ですので、使ってはいけません。
 And 条件なので Nothing のときも、そのあとの cNo.Address <> firstAddress 比較が実行され
 結果、エラーになります。
 
 Sub Sample()
 Dim cNo As Range
 Dim myR As Range
 Dim firstaddress As String
 
 With Worksheets(2).Range("A9:AZ9")
 Set cNo = .Find("部門比", LookIn:=xlValues, SearchOrder:=xlByColumns)
 
 If Not cNo Is Nothing Then
 firstaddress = cNo.Address
 Do
 If myR Is Nothing Then
 Set myR = cNo
 Else
 Set myR = Union(myR, cNo)
 End If
 
 Set cNo = .FindNext(cNo)
 
 Loop While cNo.Address <> firstaddress
 
 End If
 
 If Not myR Is Nothing Then myR.EntireColumn.Delete
 
 End With
 
 End Sub
 
 |  |