View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ivyleaf Ivyleaf is offline
external usenet poster
 
Posts: 141
Default relative columns

On Apr 3, 11:56*pm, Helmut wrote:
Hi, I have this macro:

* * Range("C1").Select
* * Range(Selection, Selection.End(xlToRight)).Select
* * ActiveCell.Range("A1:Y1").Select
* * Selection.EntireColumn.Delete
* * Selection.EntireRow.Delete

there are A1 and B1 with a value and then say X1 with a value. In between
Cells are blank. The inbetween changes...i.e. next months its not X1, its Z1
or AA1.
I have to delete the columns where the Cells are blank...i.e. C1 to W1 or Z1
and then delete the entire row.


Hi Helmut,

If you are just looking to delete all columns where the cells in row 1
are blank:

Rows(1).SpecialCells(xlCellTypeBlanks).EntireColum n.delete

Cheers,
Ivan.