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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting values in a range

Status
Not open for further replies.

danane

Technical User
Mar 23, 2006
14
CH
I want to sort a range. The problem is that the cells in column M have formulas like =MIN(H3:K3). I only want to sort the values, not the formulas.

I made a code, but the XLVALUES or something like that is missing. I don't know where to put this in ... Thanks for helping.

Code:

Range("A3:M10").sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range( "B3"), Order2:=xlAscending, Key3:=Range("M3"), Order3:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:=xlSortNormal
 
Glad you got it sorted, danane.
[cheers]

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top