LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Rank Data using VBA - having trouble with R1C1 notation

I think I figured out R1C1. This looks a bit clumsy but it seems to
work.
Now I need to learn how to select the location for the ranked data.
It's probably silly posting this since I am the only one in this
thread, but nevermind.

Sub RankData3()
Set myRange = Selection
e = InputBox("How many columns should the gap be?")
c = myRange.Columns.Count
q = myRange.Column + c - 1
t = myRange.Rows.Count + myRange.Row - 1
myRange.Copy myRange.Offset(0, c + e)
Set myData = Range(ActiveCell.Offset(1, c - 1), ActiveCell.Offset(0,
1).End(xlDown))
f = myData.Row
g = (-1 * (c + e))
myData.Offset(0, c + e).FormulaR1C1 = "=RANK(RC[" & g & "],R" & f &
"C[" & g & "]:R" & t & "C[" & g & "],0)"
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 Notation??? Clueless Excel Programming 1 September 16th 09 06:34 PM
R1C1 notation in VBA code Fred Holmes Excel Programming 8 March 21st 09 01:06 PM
Sumproduct with A1 notation instead of R1C1 sgltaylor Excel Programming 2 September 12th 08 01:04 PM
R1C1 Notation in VBA Fred Holmes Excel Programming 1 October 21st 05 09:33 PM
R1C1 Notation brym Excel Programming 4 July 27th 03 09:47 PM


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