Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default delete two columns at a time

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default delete two columns at a time

..Columns(1).Resize(,2).EntireColumn.Delete

--
Regards,
Tom Ogilvy


"John Smith" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default delete two columns at a time

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"

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
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
Excel 2007 calculate time between 2 date/time columns Kevo Excel Discussion (Misc queries) 8 April 25th 09 12:02 AM
How to delete or copy alternative rows/columns at a time? Bhagavan Excel Discussion (Misc queries) 0 May 12th 08 07:31 PM
How do I delete multiple empty columns in Excel at one time? Cindy C Excel Discussion (Misc queries) 2 October 12th 06 07:09 AM
merge text from 2 columns into 1 then delete the old 2 columns sleepindogg Excel Worksheet Functions 4 March 30th 06 07:25 PM
Delete same Rows/Columns from two worksheets at a time Vinit[_2_] Excel Programming 2 May 14th 05 04:20 AM


All times are GMT +1. The time now is 12:50 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"