Results 1 to 8 of 8

Define FirstRow & LastRow in a subset of data

Threaded View

flebber Define FirstRow & LastRow in... 08-26-2010, 11:03 AM
Bob Phillips Re: Define FirstRow & LastRow... 08-26-2010, 12:15 PM
flebber Re: Define FirstRow & LastRow... 08-26-2010, 06:30 PM
flebber Re: Define FirstRow & LastRow... 08-27-2010, 01:23 AM
Bob Phillips Re: Define FirstRow & LastRow... 08-27-2010, 04:07 AM
flebber Re: Define FirstRow & LastRow... 08-27-2010, 04:11 AM
Bob Phillips Re: Define FirstRow & LastRow... 08-27-2010, 06:23 AM
flebber Re: Define FirstRow & LastRow... 08-27-2010, 06:39 AM
  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    116

    Define FirstRow & LastRow in a subset of data

    Can you define FirstRow and LastRow functions define a set or group of number? The start and end of a set so in sampledata sheet for column A for numbers = 1 FirstRow would equal A2 and lastRow equal to A8. That would allow me to then know the range of numbers for my PercentRank function.

    I have been trying without success. My code represents where I am going but if you have other code please let me know.

    This code is attemping to define a values of a group which all have a number 1 as its value and work out the percent rank of values in Column C and return it to column D.
    LastRow = Cells(Rows.Count, 1).End(xlUp).Row
    FirstRow = Cells(Rows.Count, 1).Start(xlUp).Row
    Cellref = ?
    Dim myArray (1 to 9)
    Dim X as int
    X = 1
    For Each group In Range("A", Range("A" & Rows.Count).End(xlUp)
    
                If group.value = "X" Then 
                           PERCENTRANK(Cells("FirstRow, C": "LastRow, C", "Cellref needing loop"))
                        next X
                 next group
    End Sub
    What I am trying to acheive is column D in the Sampledata workbook.

    So that PERCENTRANK(Cells("FirstRow, C": "LastRow, C", "Cellref needing loop")) when column A equals 1 would translate to
    PERCENTRANK($C$2:$C$8,C2)
    PERCENTRANK($C$2:$C$8,C3)
    PERCENTRANK($C$2:$C$8,C3)
    PERCENTRANK($C$2:$C$8,C5)
    PERCENTRANK($C$2:$C$8,C6)
    PERCENTRANK($C$2:$C$8,C7)
    PERCENTRANK($C$2:$C$8,C8)
    And then repeat for each number in column A.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1