Re: $$Excel-Macros$$ Looping an array

2011-07-21 Thread GoldenLance
You are welcome. Oh just noticed, out of curiosity, why is my message displayed after Ashish's? I messaged it before!! On Jul 21, 2:47 am, Natron protoc...@gmail.com wrote: Thanks to both Ashish and GoldenLance. Problem solved. --

Re: $$Excel-Macros$$ Looping an array

2011-07-20 Thread Natron
Thanks to both Ashish and GoldenLance. Problem solved. -- -- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @

Re: $$Excel-Macros$$ Looping an array

2011-07-19 Thread Natron
Thanks for the reply Ashish, However I need to skip around a bit since not all columns need summed. For instance Columns 4, 7, 9 need summed but those inbetween do not. -- -- Some important links for excel users: 1.

Re: $$Excel-Macros$$ Looping an array

2011-07-19 Thread ashish koul
try this Sub enterTotals() Dim x x = Array(7, 9, 10) For i = LBound(x) To UBound(x) For Each rngArea In Columns(x(i)).SpecialCells(xlCellTypeConstants, xlNumbers).Areas With rngArea.Offset(rngArea.Rows.Count).Resize(1, 1) .FormulaR1C1 = =SUM( rngArea.Address(1, 1, xlR1C1)

Re: $$Excel-Macros$$ Looping an array

2011-07-19 Thread GoldenLance
Sub enterTotals() myArr = Array(4, 5, 7) For i = LBound(myArr) To UBound(myArr) For Each rngArea In Columns(myArr(i)).SpecialCells(2, 1).Areas With rngArea.Cells(rngArea.Cells.Count).Offset(1) .FormulaR1C1 = =SUM( rngArea.Address(1, 1, xlR1C1) )

$$Excel-Macros$$ Looping an array

2011-07-18 Thread Natron
I have a spreadsheet I need to have multiple items summed at the first blank row available...the following macro works great for Column 4 as shown below, but I need to have it run through multiple columns up to 20...I tried using an array using a for next loop on the array, but couldn't get it

Re: $$Excel-Macros$$ Looping an array

2011-07-18 Thread ashish koul
try this Sub enterTotals() lastcol = 20 For i = 4 To lastcol For Each rngArea In Columns(i).SpecialCells(xlCellTypeConstants, xlNumbers).Areas With rngArea.Offset(rngArea.Rows.Count).Resize(1, 1) .FormulaR1C1 = =SUM( rngArea.Address(1, 1, xlR1C1) )