View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joel Mills Joel Mills is offline
external usenet poster
 
Posts: 79
Default Delete Columns based on a condition

Thanks Tom this work perfectly.

"Tom Ogilvy" wrote in message
...
Sub testerBBB()
Dim rng As Range, rng1 As Range
On Error Resume Next
Set rng = Range("B2:IV2").SpecialCells(xlFormulas, xlErrors)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireColumn.Delete
Do
Set rng1 = Range("B2:IV2").Find("Grand Total", _
Lookat:=xlPart)
If rng1 Is Nothing Then Exit Do
rng1.EntireColumn.Delete
Loop While True

End Sub

--
Regards,
Tom Ogilvy




"Joel Mills" wrote in message
...
I would like to be able to delete columns in the Active Spreadsheed

based
on
cells in a Range (B2:IV2), where any cells containing #Value! or Grand
Total would result in the column being deleted. I am using Excel 2000.

Joel