LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Creating sum formula using vba

try this

firstRow = 10
lastRow = 100
incr = 4

total = 0

for i=firstRow to lastRow step incr
total = total + cells(i,col).value 'col = column number
next i

cells(row,col).value = total 'put your answer somewhere



"QB" wrote:

I need to sum every forth row between a start and end row. When I record a
macro, I get

"SUM(R[-60]C,R[-56]C,R[-52]C,R[-48],....,R[-4]C)"

If I know that I need to sum every forth row from row 3 to 59 in column E of
the active worksheet, how would I program this? I don't quite get the R[]C
format created by the macro recording.

Thank you,

QB

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating New Formula Raich Excel Worksheet Functions 1 February 15th 08 06:35 PM
CREATING A FORMULA Stan Gilbert Excel Worksheet Functions 4 October 16th 07 08:56 PM
formula creating referrrrrr Excel Discussion (Misc queries) 1 June 12th 06 06:08 PM
I need help creating a formula Kim Excel Discussion (Misc queries) 11 November 19th 05 08:01 PM
Help in creating a formula Lazurus for excel Excel Discussion (Misc queries) 1 March 6th 05 06:28 AM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"