PC Review


Reply
Thread Tools Rate Thread

delete two columns at a time

 
 
John Smith
Guest
Posts: n/a
 
      27th Oct 2006
In my script, I delete two columns one by one using the following
two lines of code:

.Columns(1).EntireColumn.Delete
.Columns(1).EntireColumn.Delete

Can one command do the job instead of two? Thanks.
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      27th Oct 2006
..Columns(1).Resize(,2).EntireColumn.Delete

--
Regards,
Tom Ogilvy


"John Smith" <(E-Mail Removed)> wrote in message
news:erI9P$V%(E-Mail Removed)...
> In my script, I delete two columns one by one using the following
> two lines of code:
>
> .Columns(1).EntireColumn.Delete
> .Columns(1).EntireColumn.Delete
>
> Can one command do the job instead of two? Thanks.



 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      27th Oct 2006
All of these work and there are more available...
Columns("A:B").Delete
Range("A1:B1").EntireColumn.Delete
Range(Columns(1), Columns(2)).Delete
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"John Smith"
<(E-Mail Removed)>
wrote in message
two lines of code:
.Columns(1).EntireColumn.Delete
.Columns(1).EntireColumn.Delete
Can one command do the job instead of two? Thanks.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete or copy alternative rows/columns at a time? Bhagavan Microsoft Excel Misc 0 12th May 2008 07:31 PM
create a macro to delete columns and then border remaining columns =?Utf-8?B?SmFuZTc3Nw==?= Microsoft Excel Programming 1 18th Jul 2007 12:08 AM
How do I delete multiple empty columns in Excel at one time? =?Utf-8?B?Q2luZHkgQw==?= Microsoft Excel Misc 2 12th Oct 2006 07:09 AM
merge text from 2 columns into 1 then delete the old 2 columns =?Utf-8?B?c2xlZXBpbmRvZ2c=?= Microsoft Excel Worksheet Functions 4 30th Mar 2006 07:25 PM
Delete same Rows/Columns from two worksheets at a time Vinit Microsoft Excel Programming 2 14th May 2005 04:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:10 PM.