ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort method possible without using select (https://www.excelbanter.com/excel-programming/361825-sort-method-possible-without-using-select.html)

WhytheQ

Sort method possible without using select
 
This is what i have:

Sheets("Data1").Select
Range("DailyMeasures").Sort Key1:=Range("A4"), Order1:=xlAscending
(where DailyMeasures is a named range in the worksheet Data1)

Is it possible to carry out this sort method without having to actually
Select the sheet.

Any help appreciated
Jason.


Rick Hansen

Sort method possible without using select
 
Good Morning Jason,
I believe this is what you are looking for. You don't have select sheet
or range to do the sort. Have a great day..

Rick, (Fairbanks, AK {Land of the Midnight Sun})

============================

Dim ws as worksheet
Dim DmRng as Range

set ws = worksheets("Data1")
set DmRng = ws.Range("DailyMeasures")

DmRng.Sort Key1:=Range("A4"), Order1:=xlAscending ......

============================

"WhytheQ" wrote in message
oups.com...
This is what i have:

Sheets("Data1").Select
Range("DailyMeasures").Sort Key1:=Range("A4"), Order1:=xlAscending
(where DailyMeasures is a named range in the worksheet Data1)

Is it possible to carry out this sort method without having to actually
Select the sheet.

Any help appreciated
Jason.




havocdragon

Sort method possible without using select
 
Or for less coding you can just do

range("").sort Key1:=Range("A4"), Order1:=xlAscending

"Rick Hansen" wrote:

Good Morning Jason,
I believe this is what you are looking for. You don't have select sheet
or range to do the sort. Have a great day..

Rick, (Fairbanks, AK {Land of the Midnight Sun})

============================

Dim ws as worksheet
Dim DmRng as Range

set ws = worksheets("Data1")
set DmRng = ws.Range("DailyMeasures")

DmRng.Sort Key1:=Range("A4"), Order1:=xlAscending ......

============================

"WhytheQ" wrote in message
oups.com...
This is what i have:

Sheets("Data1").Select
Range("DailyMeasures").Sort Key1:=Range("A4"), Order1:=xlAscending
(where DailyMeasures is a named range in the worksheet Data1)

Is it possible to carry out this sort method without having to actually
Select the sheet.

Any help appreciated
Jason.






All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com