Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Delete Columns if sum is 0

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Delete Columns if sum is 0

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Delete Columns if sum is 0

How can I set the pop up message, for one folder that include excel
file to delete columns?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Delete Columns if sum is 0

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
wrote:

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


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
VB to delete columns except these... AndrewB Excel Programming 3 May 4th 10 06:40 AM
Delete & Merge Columns,Delete Rows with filter, etc traderindia Excel Programming 1 July 16th 09 08:17 PM
create a macro to delete columns and then border remaining columns Jane777 Excel Programming 1 July 18th 07 12:08 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 Columns Jean[_5_] Excel Programming 1 March 5th 04 02:03 PM


All times are GMT +1. The time now is 01:00 AM.

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

About Us

"It's about Microsoft Excel"