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) & ")" .Interior.ColorIndex = 6 End With Next rngArea Next End Sub On Tue, Jul 19, 2011 at 7:09 PM, Natron <protoc...@gmail.com> wrote: > 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. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- *Regards* * * *Ashish Koul* *akoul*.*blogspot*.com <http://akoul.blogspot.com/> http://akoul.posterous.com/ *akoul*.wordpress.com <http://akoul.wordpress.com/> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> P Before printing, think about the environment. -- ---------------------------------------------------------------------------------- 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 @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel