Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CurrentRegion.sort 1

Status
Not open for further replies.

WaterSprite

Technical User
Mar 23, 2004
69
0
0
US
The Macro recorder gave me this:
[Range("A1:K11588").Sort Key1:=Range("A1"),]

The bottom row will not always be 11588, so,

Can I replace the hard coded range with:
[With Activesheet]
[.cells(1,1).currentregion.sort]
 
Did you try it ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
yes, but with 11,588 rows and 10 columns, it is not easy to check each row to see how the sort worked. The data I am being given to work with has been downloaded to Excel from something called "Crystal Reports", and I have had more than my share of trouble writing code that works.
So, I thought to ask here to see if I was on the right track.
 


hi,

There is a [highlight]Select Current Region[/highlight] ICON that you can add to your available icons. Select A1 and then hit the [highlight]Select Current Region[/highlight] icon and then OBSERVE the selected range. It will give you a warm fuzzy.

BTW, code, similar to your posted code using CurrentRegion, is a technique that I use most often.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top