Range Selection - From Lowest 2 Highest Values?

  • Thread starter Faraz A. Qureshi
  • 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;
 
J

Jacob Skaria

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top