View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme[_2_] Bernard Liengme[_2_] is offline
external usenet poster
 
Posts: 563
Default Increment value in a Formula

Are you interested in a non-VBA method?
Let's say the formulas are to be on Sheet2. The first one in D2, the next in
E2, etc.
So we have (let's forget the IF part for now)
D2 E2
F2
=SUM(H1675:J1686) =SUM(H1687:J1698) =SUM(H1699:J1710)
In D2 enter
=SUM(INDIRECT("Section3!H"&1675+12*(COLUMN(A1)-1)&":J"&1686+12*(COLUMN(A1)-1)))
Format this cell with custom format such as: 0;0;;@ to hide any zero results
Drag D2's fill handle to the right as far as you need to go.
No matter where you start your formulas, leave the reference to COLUMN(A1)
unchanged.
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"David Marr" <David wrote in message
...
Hi,

I'm using Excel version 2003.

I have the following formula =IF(SUM('Section
3'!$H$1675:$J$1686)=0,"",SUM('Section 3'!$H$1675:$J$1686)) and would like
to
increment the cell references by 12.

I was wondering if there is a way to do this using a bit of VBA code?

So the result i'm looking for after code run is =IF(SUM('Section
3'!$H$1687:$J$1698)=0,"",SUM('Section 3'!$H$1687:$J$1698)).

I will be running the formula along the columns so will need to increment
the formula by 12 for each new column.

Thanks
Dave