Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Deleting Columns

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Deleting Columns

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)

"Jim Berglund" wrote in message ...
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Deleting Columns

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


"Jim Berglund" wrote in message
...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting columns Barry Lennox[_2_] Excel Discussion (Misc queries) 3 January 8th 09 10:00 PM
Adding Columns, Then deleting old columns May Excel Discussion (Misc queries) 4 October 30th 08 04:44 PM
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
Deleting columns surg4u1975 New Users to Excel 3 December 16th 05 07:09 PM
deleting columns c_new Excel Discussion (Misc queries) 4 October 26th 05 02:46 PM


All times are GMT +1. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"