Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default sort question

Hi all

Must a ws be active to do a sort?

I have a button on sheet1 that, among other things, sorts data on sheet2,
before reactivating sheet1. Everything works fine, but I'd just as soon not
show the data on sheet 2 during the sort.

Any clues appreciated
anny


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default sort question

No it doesn't have to be active - it tends to be when the macro's been
recorded but you can jig the code so that the range being sorted is connected
directly to the sort method. You've just got to be careful you've specified
the correct sheet, not just as the range but as the key as well. Eg:

Worksheets("sheet1").Range("A1:A9").Sort
Key1:=Worksheets("sheet1").Range("A1"), Order1:=xlAscending

"anny" wrote:

Hi all

Must a ws be active to do a sort?

I have a button on sheet1 that, among other things, sorts data on sheet2,
before reactivating sheet1. Everything works fine, but I'd just as soon not
show the data on sheet 2 during the sort.

Any clues appreciated
anny



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default sort question

Why not just try it and see what happens?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"anny" wrote in message
...
Hi all

Must a ws be active to do a sort?

I have a button on sheet1 that, among other things, sorts data on sheet2,
before reactivating sheet1. Everything works fine, but I'd just as soon

not
show the data on sheet 2 during the sort.

Any clues appreciated
anny




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default sort question

Well I did try it, to no avail. It turns out I hadn't specified the sheet
in the' key1:=', only the range, as Martin suggested above.

Thanks to both
anny

"Bob Phillips" wrote in message
...
Why not just try it and see what happens?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"anny" wrote in message
...
Hi all

Must a ws be active to do a sort?

I have a button on sheet1 that, among other things, sorts data on
sheet2,
before reactivating sheet1. Everything works fine, but I'd just as soon

not
show the data on sheet 2 during the sort.

Any clues appreciated
anny






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort Question dwake Excel Discussion (Misc queries) 5 May 4th 10 05:32 PM
A question (sort of) Joe C Excel Discussion (Misc queries) 4 January 24th 08 03:03 PM
sort question D Excel Worksheet Functions 0 August 2nd 06 10:08 PM
Sort question pgruening Excel Discussion (Misc queries) 0 May 18th 06 08:22 PM
Sort Question Patrick Simonds Excel Programming 5 December 21st 05 07:09 AM


All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"