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 Ranking formula - R[1]C[1]

I need to loop a ranking formula. The problem I am having
is with the R[1]C[1] method.

Here's what I have.
lngRow = 6

For lngRow2 = lngSecondRow To lngLastRow2 Step 1
If Len(RTrim$(.Cells(lngRow2, 2))) 0 Then
Cells(lngRow2, 1).FormulaR1C1 = _
'PROBLEM IS HERE!!!
"=RANK(R[" & lngRow & "]C[9],myrank)"
lngRow = lngRow + 1
End If
Next lngRow2

It will work if the formula we
"=RANK(R[-67]C[9],myrank)" , but, it won't always be that
many rows.

Please help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default looping Ranking formula - R[1]C[1]

Hi:

I'm not sure what you mean by "PROBLEM IS HERE". I'm not having any problem
with the following:

Sub RankFormula()
Dim lngRow As Integer
lngRow = -12
ActiveCell.FormulaR1C1 = "=RANK(R[" & lngRow & "]C[],myrank)"
End Sub

Regards,

Vasant.


"MDC" wrote in message
...
I need to loop a ranking formula. The problem I am having
is with the R[1]C[1] method.

Here's what I have.
lngRow = 6

For lngRow2 = lngSecondRow To lngLastRow2 Step 1
If Len(RTrim$(.Cells(lngRow2, 2))) 0 Then
Cells(lngRow2, 1).FormulaR1C1 = _
'PROBLEM IS HERE!!!
"=RANK(R[" & lngRow & "]C[9],myrank)"
lngRow = lngRow + 1
End If
Next lngRow2

It will work if the formula we
"=RANK(R[-67]C[9],myrank)" , but, it won't always be that
many rows.

Please help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default looping Ranking formula - R[1]C[1]

I can't use "lngRow = -12" because the number of rows may
vary. The lngRow will always start in row 6.

-----Original Message-----
Hi:

I'm not sure what you mean by "PROBLEM IS HERE". I'm not

having any problem
with the following:

Sub RankFormula()
Dim lngRow As Integer
lngRow = -12
ActiveCell.FormulaR1C1 = "=RANK(R[" & lngRow & "]C

[],myrank)"
End Sub

Regards,

Vasant.


"MDC" wrote in

message
...
I need to loop a ranking formula. The problem I am

having
is with the R[1]C[1] method.

Here's what I have.
lngRow = 6

For lngRow2 = lngSecondRow To lngLastRow2 Step 1
If Len(RTrim$(.Cells(lngRow2, 2))) 0 Then
Cells(lngRow2, 1).FormulaR1C1 = _
'PROBLEM IS HERE!!!
"=RANK(R[" & lngRow & "]C[9],myrank)"
lngRow = lngRow + 1
End If
Next lngRow2

It will work if the formula we
"=RANK(R[-67]C[9],myrank)" , but, it won't always be

that
many rows.

Please help



.

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
help formula (ranking) Eddy Stan Excel Worksheet Functions 1 October 26th 09 12:36 PM
Ranking Formula carl Excel Worksheet Functions 6 April 7th 09 05:07 AM
Help in ranking Formula George Excel Worksheet Functions 9 December 30th 08 05:56 PM
creating a looping formula between different spreadsheets Jon Buonocore New Users to Excel 0 March 28th 06 04:29 AM
Ranking Formula Todd Nelson Excel Discussion (Misc queries) 5 February 2nd 06 11:26 PM


All times are GMT +1. The time now is 01:52 PM.

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"