Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort Question | Excel Discussion (Misc queries) | |||
A question (sort of) | Excel Discussion (Misc queries) | |||
sort question | Excel Worksheet Functions | |||
Sort question | Excel Discussion (Misc queries) | |||
Sort Question | Excel Programming |