View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default delete columns if cells have no data

Post your formulas.

If they are formulas that return a string "" then this macro will do the
job.

Sub test()
For Each cell In ActiveSheet.Range("C1:BH500")
If cell = "" Then
cell.ClearContents
End If
Next cell
End Sub


Gord Dibben MS Excel MVP

On Tue, 4 Aug 2009 08:26:02 -0700, wizardmalcolm
wrote:

.Hi
I have a worksheet where rows 1 & 2 and columns A & B are fixed headings.
I would like a macro where any columns (C:BH) are deleted if they have no
data.
All of the cells in the range (C3:BH500) have formulas.
I have tried to adapt other similar solutions found here, but to no avail.
Any help would be greatly appreciated.

Malcolm