View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O Dave O is offline
external usenet poster
 
Posts: 427
Default Code to delete columns meeting a condition

I got results with this:

Sub DeleteColumnsGreaterThanH1()
Range("be2").Select
Do While Selection.Column 8
If ActiveCell.Value Range("h1").Value Then
Selection.EntireColumn.Delete
ActiveCell.Offset(0, -1).Select
Loop
End Sub