#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default VBA RANK

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default VBA RANK

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default VBA RANK

Thanks, how about looping through the range, like range(D & value) =
WorksheetFunction.Rank(Range("A7"), is this possible? so I can get the top
ten

"OssieMac" wrote:

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default VBA RANK

I really do not understand what you are trying to achieve. Can you give me a
sample list of about 20 numbers and a sample of what the output should be
with an explanation of what it is you are trying to achieve.


--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks, how about looping through the range, like range(D & value) =
WorksheetFunction.Rank(Range("A7"), is this possible? so I can get the top
ten

"OssieMac" wrote:

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default VBA RANK

Thanks a lot for your help, I figured it out.
I have another question, how do I deal with Blanks and nulls

"OssieMac" wrote:

I really do not understand what you are trying to achieve. Can you give me a
sample list of about 20 numbers and a sample of what the output should be
with an explanation of what it is you are trying to achieve.


--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks, how about looping through the range, like range(D & value) =
WorksheetFunction.Rank(Range("A7"), is this possible? so I can get the top
ten

"OssieMac" wrote:

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default VBA RANK

Hi again,

Following line tests for a blank cell. You can use a variable representing
the range.

If Range("A1") = "" Then
'place code here for blank cell
Else
'place code here for not blank
End If

Can also test for not blank.

If Range("A1") < "" Then

Note that there is no space between the double quotes.



--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks a lot for your help, I figured it out.
I have another question, how do I deal with Blanks and nulls

"OssieMac" wrote:

I really do not understand what you are trying to achieve. Can you give me a
sample list of about 20 numbers and a sample of what the output should be
with an explanation of what it is you are trying to achieve.


--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks, how about looping through the range, like range(D & value) =
WorksheetFunction.Rank(Range("A7"), is this possible? so I can get the top
ten

"OssieMac" wrote:

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default VBA RANK

Thanks everything is working.

"OssieMac" wrote:

Hi again,

Following line tests for a blank cell. You can use a variable representing
the range.

If Range("A1") = "" Then
'place code here for blank cell
Else
'place code here for not blank
End If

Can also test for not blank.

If Range("A1") < "" Then

Note that there is no space between the double quotes.



--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks a lot for your help, I figured it out.
I have another question, how do I deal with Blanks and nulls

"OssieMac" wrote:

I really do not understand what you are trying to achieve. Can you give me a
sample list of about 20 numbers and a sample of what the output should be
with an explanation of what it is you are trying to achieve.


--
Regards,

OssieMac


"djdwwoug" wrote:

Thanks, how about looping through the range, like range(D & value) =
WorksheetFunction.Rank(Range("A7"), is this possible? so I can get the top
ten

"OssieMac" wrote:

Not sure that I understand your question but the following examples of VBA
code might put you on the right track.

Range("D1") = WorksheetFunction.Rank(Range("A7"), _
Range("A$7:A$200")) + WorksheetFunction.CountIf(Range("A$7:A7"), _
Range("A7")) - 1

Range("E1") = WorksheetFunction.Min(Range("A$7:A7"))

Range("F1") = WorksheetFunction.Max(Range("A$7:A7"))

--
Regards,

OssieMac


"djdwwoug" wrote:

is there a way that I can make this formula into
VBA code that looks up a given range see below
=RANK(A7,A$7:A$200)+COUNTIF(A$7:A7,A7)-1

and then used VBA the to get the Large and Small values

Thanks

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
RANK, duplicate ranking but no gaps in rank arron laing Excel Worksheet Functions 4 June 14th 06 07:57 AM
Rank(A1,C1:C5) - Rank using 2 ranges goofy11 Excel Worksheet Functions 3 June 9th 06 06:03 AM
Rank where lowest value is highest rank mile3024 Excel Worksheet Functions 2 December 9th 05 10:57 PM
Does Correl/Rank combo work eg CORREL(cols E & H) where E&H=RANK(. Emmanuel Excel Worksheet Functions 3 November 12th 05 03:33 PM
Rank items, select one start date, have remaining dates follow based on rank rob normerica Excel Discussion (Misc queries) 1 August 15th 05 09:36 PM


All times are GMT +1. The time now is 06:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"