Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search an array in reverse (bottom to top) order | Excel Discussion (Misc queries) | |||
Is it possible to display the row of tabs (sheets) at the bottom across two rows? | Excel Discussion (Misc queries) | |||
Adding in row at bottom of range | Excel Programming | |||
Adding info in the row at the bottom using macro? | Excel Discussion (Misc queries) | |||
2 questions sheets displayed at bottom | Excel Programming |