LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default ActiveFormula R1C1

Hi,

i am trying to sum a range of values from coloumn H to Column i. i is a
variable, and it depends on the input no for Cloumn F. If column F is 6, that
means that values need to be summed up from Column H to M( 6 columns
counting from H as a reference). but this does not work, can anyone advise
anything wrong with my code??? The result will be returned in Column G.

pls see code below:

Sub Book1()
Application.ScreenUpdating = False

Dim CurrentRow As Integer
Dim NumOfRows As Integer
Dim i As Integer


NumOfRows = Cells(Rows.Count, 1).End(xlUp).Row

For CurrentRow = 2 To NumOfRows
i = Cells(CurrentRow, "F").Value

With ActiveSheet
.Range("G2").Select
.Range("G" & CurrentRow).FormulaR1C1 _
= "=SUM(RC[1]:RC[i])"
End With
Next


Application.ScreenUpdating = True
End Sub


 
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
R1C1 stacia Excel Discussion (Misc queries) 1 February 16th 10 06:46 PM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Discussion (Misc queries) 3 September 13th 07 08:31 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Worksheet Functions 3 September 13th 07 08:31 AM
R1C1 Arne Hegefors Excel Discussion (Misc queries) 1 August 18th 06 10:11 AM
R1C1 Fix Poseur Excel Programming 5 December 2nd 04 08:52 PM


All times are GMT +1. The time now is 02:46 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"