Deleting Columns

  • Thread starter Thread starter Jim Berglund
  • Start date Start date
J

Jim Berglund

Why don't these work? (numberof Columns is properly defined)

Range.(Column(numberofColumns + 3),Column(numberofColumns + 17)).Select
Selection.Delete Shift:=xlToLeft



Columns(numberofColumns + 3, numberofColumns + 17).Select
Selection.Delete Shift:=xlToLeft

What should I do, instead?

Thanks.

Jim Berglund
 
Jim,

You could try

Range(Cells(numberofColumns + 3, 1), Cells(numberofColumns + 17, 1)).EntireColumn.Delete


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Why don't these work? (numberof Columns is properly defined)

Range.(Column(numberofColumns + 3),Column(numberofColumns + 17)).Select
Selection.Delete Shift:=xlToLeft



Columns(numberofColumns + 3, numberofColumns + 17).Select
Selection.Delete Shift:=xlToLeft

What should I do, instead?

Thanks.

Jim Berglund
 
Just a couple of typos (or possibly syntax errors)

Range(Columns(numberofColumns + 3),Columns(numberofColumns + 17)).Select
Selection.Delete Shift:=xlToLeft

or
Range(Columns(numberofColumns + 3),Columns(numberofColumns + 17)) _
.Delete Shift:=xlToLeft
without selecting.
--
Regards,
Tom Ogilvy


Why don't these work? (numberof Columns is properly defined)

Range.(Column(numberofColumns + 3),Column(numberofColumns + 17)).Select
Selection.Delete Shift:=xlToLeft



Columns(numberofColumns + 3, numberofColumns + 17).Select
Selection.Delete Shift:=xlToLeft

What should I do, instead?

Thanks.

Jim Berglund
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top