Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Adding Sum to bottom of Col C for all Sheets in Array

I have 10 sheets that are formatted with the currency in column C. I would
like to call a sub at the end of a macro to add the sum of col C to each
sheet in the workbook. My problem is each sheet has a variable number of
rows so I'm not sure how to say add empty row then add sum at bottom of
column C. Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Adding Sum to bottom of Col C for all Sheets in Array

One solution would be to set your totals in column C65536, then hide all
unused rows.

HTH
--
AP

"SITCFanTN" a écrit dans le message de
news: ...
I have 10 sheets that are formatted with the currency in column C. I would
like to call a sub at the end of a macro to add the sum of col C to each
sheet in the workbook. My problem is each sheet has a variable number of
rows so I'm not sure how to say add empty row then add sum at bottom of
column C. Thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding Sum to bottom of Col C for all Sheets in Array


Hi

You could try this code
Sub loop_worksheets()
Dim MyArray, MyInt
sheet_count = ActiveWorkbook.Sheets.Count
'Changes this for your worksheets
MyArray = Array("Sheet1", "Sheet2", "Sheet3")
For j = 0 To sheet_count - 1
sname = MyArray(j)
Sheets(sname).Select
rowcount = Cells(Cells.Rows.Count, "c").End(xlUp).Row
Range("c" & rowcount + 1).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-" & rowcount & "]C:R[-1]C)"
Next
End Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=561047

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
search an array in reverse (bottom to top) order Trainer_00 Excel Discussion (Misc queries) 5 December 20th 07 10:35 PM
Is it possible to display the row of tabs (sheets) at the bottom across two rows? JEFF Excel Discussion (Misc queries) 1 April 17th 07 01:30 AM
Adding in row at bottom of range Graham Haughs Excel Programming 4 March 27th 06 08:03 PM
Adding info in the row at the bottom using macro? Carrie Excel Discussion (Misc queries) 1 April 14th 05 04:18 PM
2 questions sheets displayed at bottom Mary Agnes Excel Programming 1 March 1st 04 03:05 PM


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

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"