Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Selecting a worksheet without making it active

How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Selecting a worksheet without making it active

screenupdating.false?

and true after

"ordnance1" wrote:

How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 52
Default Selecting a worksheet without making it active

But that does not keep the sheet from becoming Active.

"pswanie" wrote:

screenupdating.false?

and true after

"ordnance1" wrote:

How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Selecting a worksheet without making it active

still kinda newb.... so pardon but what u mean with not making it active?

"ordnance1" wrote:

But that does not keep the sheet from becoming Active.

"pswanie" wrote:

screenupdating.false?

and true after

"ordnance1" wrote:

How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a worksheet without making it active

With workSheets("AAA-Supervisor")
with .range(Y2:Z24")
.cells.Sort Key1:=.columns(1), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal
end with
end with

And I bet you know your data. I wouldn't let excel guess whether you have
headers. I'd use xlyes or xlno.

ps. I think I got all your typos, but I didn't test it. It's better to copy
from the code window and paste directly into your message.



ordnance1 wrote:

How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting a worksheet without making it active

Just join the Select/Selections together to eliminate them. After correcting
your syntax errors (I think I got them all), this should be equivalent to
what your posted code was doing (assuming you had the correct syntax
originally)...

Worksheets("AAA-Supervisor").Range("Y2:Z24").Sort Key1:=Range("y4"), _
Order1:=x_Ascending, Header:=xlGuese, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Rick


"ordnance1" wrote in message
...
How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selecting a worksheet without making it active

xlguese and x_ascending are still there and that range("y4") is unqualified.

Worksheets("AAA-Supervisor").Range("Y2:Z24").Sort _
Key1:=Worksheets("AAA-Supervisor").Range("y4"), _
Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal



"Rick Rothstein (MVP - VB)" wrote:

Just join the Select/Selections together to eliminate them. After correcting
your syntax errors (I think I got them all), this should be equivalent to
what your posted code was doing (assuming you had the correct syntax
originally)...

Worksheets("AAA-Supervisor").Range("Y2:Z24").Sort Key1:=Range("y4"), _
Order1:=x_Ascending, Header:=xlGuese, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Rick

"ordnance1" wrote in message
...
How can I change my code below so the sort will perform without making
AAA-Supervisor the active shett?

Sheets("AAA-Supervisor").Select
range(Y2:Z24").Select
Selection.Sort Key1:=range("y4"). Order1:=x;Ascending, Header:=xlGuese, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom,_
DataOption1:=xlSortNormal


--

Dave Peterson
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
making a different sheet active Charlie Excel Programming 3 December 25th 07 04:47 PM
Trouble making another worksheet active Todd K. Excel Programming 3 October 5th 07 07:28 PM
Selecting an Excel tab, Delete Worksheet command is not active missyjes New Users to Excel 1 September 23rd 05 03:16 PM
Making an open workbook active Jay Oken Excel Programming 1 March 19th 05 11:44 PM
Summing a range without making it active Garry Douglas Excel Programming 1 December 29th 04 05:19 AM


All times are GMT +1. The time now is 06:30 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"