Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Range Selection - From Lowest 2 Highest Values?

I usually have a long list of accounts imported with account numbers in 12
digits' numbers. The same is however already sorted. How to select the range
of codes, from lowest to the highest codes?

For example:

1. In the currently active column;

2. Select FROM the minimum value above 000000000000;

3. UPTO the maximum value below 1000000000000;

--
Best Regards,

Faraz
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Range Selection - From Lowest 2 Highest Values?

Try the below with data in Col A

Dim rngTemp As Range, lngMinRow As Long, lngMaxrow As Long
Set rngTemp = Columns("A")
lngMinRow = rngTemp.Find(WorksheetFunction.Min(rngTemp)).Row
lngMaxrow = rngTemp.Find(WorksheetFunction.Max(rngTemp)).Row
Range("A" & lngMinRow & ":A" & lngMaxrow).Select

If this post helps click Yes
---------------
Jacob Skaria


"Faraz A. Qureshi" wrote:

I usually have a long list of accounts imported with account numbers in 12
digits' numbers. The same is however already sorted. How to select the range
of codes, from lowest to the highest codes?

For example:

1. In the currently active column;

2. Select FROM the minimum value above 000000000000;

3. UPTO the maximum value below 1000000000000;

--
Best Regards,

Faraz

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Range Selection - From Lowest 2 Highest Values?

Just as usual buddy!

U R simply the best!
--
Best Regards,

Faraz


"Jacob Skaria" wrote:

Try the below with data in Col A

Dim rngTemp As Range, lngMinRow As Long, lngMaxrow As Long
Set rngTemp = Columns("A")
lngMinRow = rngTemp.Find(WorksheetFunction.Min(rngTemp)).Row
lngMaxrow = rngTemp.Find(WorksheetFunction.Max(rngTemp)).Row
Range("A" & lngMinRow & ":A" & lngMaxrow).Select

If this post helps click Yes
---------------
Jacob Skaria


"Faraz A. Qureshi" wrote:

I usually have a long list of accounts imported with account numbers in 12
digits' numbers. The same is however already sorted. How to select the range
of codes, from lowest to the highest codes?

For example:

1. In the currently active column;

2. Select FROM the minimum value above 000000000000;

3. UPTO the maximum value below 1000000000000;

--
Best Regards,

Faraz

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
Question about returning some values from highest to lowest Cory from Eugene[_2_] Excel Discussion (Misc queries) 3 February 21st 08 06:39 PM
Averaging without the highest or lowest values leadfoot Excel Discussion (Misc queries) 4 November 1st 07 02:51 PM
Scores of a Range Cells. Highest or lowest depending a parameter cradino Excel Worksheet Functions 1 March 11th 07 08:09 AM
Average of values in row excluding the highest and lowest value? frosterrj Excel Worksheet Functions 18 November 22nd 06 07:28 PM
Formula to higlight highest and lowest values in row michelle Excel Worksheet Functions 4 November 20th 06 09:51 PM


All times are GMT +1. The time now is 03:54 AM.

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"