PC Review


Reply
Thread Tools Rate Thread

Delete Columns if sum is 0

 
 
beancurd
Guest
Posts: n/a
 
      26th May 2010
Hi,

I want to delete columns if the total is 0
background: excel file columns I to X want to delete if whole column's
SUM is 0.
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      26th May 2010
Sub delCol()
Dim lr As Long, sh As Worksheet
Set sh = ActiveSheet
For i = 24 To 9 Step -1
lr = sh.Cells(Rows.Count, i).End(xlUp).Row
If WorksheetFunction.Sum(Range(sh.Cells(1, i), _
sh.Cells(lr, i))) = 0 Then
Columns(i).Delete
End If
Next
End Sub




"beancurd" <(E-Mail Removed)> wrote in message
news:ff6eb63a-2b7e-4ee7-bbef-(E-Mail Removed)...
> Hi,
>
> I want to delete columns if the total is 0
> background: excel file columns I to X want to delete if whole column's
> SUM is 0.



 
Reply With Quote
 
beancurd
Guest
Posts: n/a
 
      27th May 2010
How can I set the pop up message, for one folder that include excel
file to delete columns?
 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      27th May 2010
Start by re-writing your description of what you would like to have done.

Does not make sense as it is.


Gord Dibben MS Excel MVP

On Thu, 27 May 2010 09:04:04 -0700 (PDT), beancurd
<(E-Mail Removed)> wrote:

>How can I set the pop up message, for one folder that include excel
>file to delete columns?


 
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
Re: Delete & Merge Columns,Delete Rows with filter, etc Matthew Herbert Microsoft Excel Programming 0 16th Jul 2009 08:17 PM
delete columns Moh Microsoft Excel Programming 4 14th Dec 2007 04:06 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
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 Columns Curtill Microsoft Excel Charting 1 28th Feb 2004 02:13 AM


Features
 

Advertising
 

Newsgroups
 


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