LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Extend to more columns

Hi, the following code sums Column B,
However I need to do the same for each column, B-I.
Then, If a sum = 0 I need to delete that column,
the following code requires a few extra lines, help is much appreciated

Sub intq()

Dim intNumRows As Integer, c As Variant, lngCellTotal As Long


intNumRows = Cells(50, "h").End(xlUp).Row
With Range("h" & intNumRows + 1)
' .Borders(xlEdgeLeft).Weight = xlMedium
.Borders(xlEdgeTop).Weight = xlMedium

End With
For Each c In Range("h1", "h" & intNumRows)
lngCellTotal = lngCellTotal + c.Value
Next
Range("h" & intNumRows + 1) = lngCellTotal
* If lngCellTotal = 0 Then
* Range("IngCellTotal").Columns.Delete

* End If

End Sub

 
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
Extend formula row reference across columns Joe M. Excel Discussion (Misc queries) 1 April 22nd 10 06:32 PM
how do I extend sub-columns into one long row? Brenda Excel Worksheet Functions 4 October 9th 07 09:55 PM
Extend Excel Workbook Columns to 366 ExcelERATOR Excel Worksheet Functions 1 February 1st 06 12:05 AM
How can I extend the maximum # of columns to 500 Me Setting up and Configuration of Excel 3 January 13th 05 11:04 PM
How can I extend the maximum # of columns to 500 Me Setting up and Configuration of Excel 0 January 11th 05 09:37 PM


All times are GMT +1. The time now is 07:10 AM.

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"