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) & ")" .Interior.ColorIndex = 6 End With Next rngArea Next i End Sub
On Jul 19, 6:39 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