Range Selection - From Lowest 2 Highest Values?

  • Thread starter Thread starter Faraz A. Qureshi
  • Start date Start date
F

Faraz A. Qureshi

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;
 
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
 
Back
Top