Sort method possible without using select

W

WhytheQ

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.
 
R

Rick Hansen

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 ......

============================
 
G

Guest

Or for less coding you can just do

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

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