Thread: Delete Columns
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Delete Columns

It's very much the same. See other reply.
--
HTH,
Barb Reinhardt



"BP" wrote:

Thanks but I need to specify different columns ranges on different worksheets
--
BP


"Barb Reinhardt" wrote:

THis will delete it on every worksheet

Dim WS as Worksheet

For Each WS in ActiveWorkbook.Worksheets
WS.Columns("AA:AY").Delete
Next WS
--
HTH,
Barb Reinhardt



"BP" wrote:

Sorry I am new to VB and I forgot the code:

I am trying to cycle thru the worksheets and remove certain columns.

I tried this and get a delete method of range class error

ActiveWorkbook.Worksheets("Sheet1").Select
Worksheet.Columns("AA:AY").Delete Shift:=xlToLeft

Any help would be appreciated.



--
BP


"TomPl" wrote:

What is the question?