Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default looping formula - r1c1 problem

I need to loop a formula that references a cell.

A B
1 123 939
2 121 192
3 122 121
4 422 121
....
12 989 121
13 784 623

I need to place a formula in cell A20 (example) that is a
ranking of the items in range("A1:A13"). The problem I
run into is using the r1c1 formula, because the next time
I run the code, the number of rows may be different (i.e.
need to place the formula in cell A5000 and can't simply
use R[-19]C)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default looping formula - r1c1 problem

Will the formula always be 7 cells past the last entry in the ranked list

Range("A1").End(xldown).Offset(7,0).FormulaR1C1 = "=Sum(R1C:R[-7]C)"

This uses the sum as an example since you didn't say what type of ranking
you are doing.

--
Regards,
Tom Ogilvy

"MDC" wrote in message
...
I need to loop a formula that references a cell.

A B
1 123 939
2 121 192
3 122 121
4 422 121
...
12 989 121
13 784 623

I need to place a formula in cell A20 (example) that is a
ranking of the items in range("A1:A13"). The problem I
run into is using the r1c1 formula, because the next time
I run the code, the number of rows may be different (i.e.
need to place the formula in cell A5000 and can't simply
use R[-19]C)




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default looping formula - r1c1 problem

The problem isn't how far down from the bottom of the
original list, the problem is how many rows back UP to row
6.

rank formula =RANK(J6,J6:J67)

SO...Cells(lngRow, 1).FormulaR1C1 = _
"=RANK(R[???]C[9],myrank)"

AND the problem is that the next time I need this the
range will change, e.g. J6:J78

-----Original Message-----
Will the formula always be 7 cells past the last entry in

the ranked list

Range("A1").End(xldown).Offset(7,0).FormulaR1C1 = "=Sum

(R1C:R[-7]C)"

This uses the sum as an example since you didn't say what

type of ranking
you are doing.

--
Regards,
Tom Ogilvy

"MDC" wrote in

message
...
I need to loop a formula that references a cell.

A B
1 123 939
2 121 192
3 122 121
4 422 121
...
12 989 121
13 784 623

I need to place a formula in cell A20 (example) that is

a
ranking of the items in range("A1:A13"). The problem I
run into is using the r1c1 formula, because the next

time
I run the code, the number of rows may be different

(i.e.
need to place the formula in cell A5000 and can't simply
use R[-19]C)




.

Reply
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 formula question igorek Excel Worksheet Functions 2 October 5th 07 02:58 AM
help on Converting R1C1 to A1 and A1 to R1C1..tia sa2 temp Excel Worksheet Functions 3 September 13th 07 08:31 AM
Scrolling Looping Problem Nick Wakeham Excel Discussion (Misc queries) 0 June 12th 07 01:42 PM
Macro looping problem. [email protected] Excel Discussion (Misc queries) 8 October 26th 06 02:44 PM
R1C1 Formula in Excel Barb Reinhardt Excel Worksheet Functions 2 December 8th 05 02:40 PM


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