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

I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Selecting range question

Todd,

You rarely ever need to select anything: post all your code, and we can give
you some pointers as to how to re-write without using select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Selecting range question

Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all your

code, and we can give
you some pointers as to how to re-write without using

select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in

message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Selecting range question

Todd,

Sheets("TEST").Range("A1:F129").Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


HTH,
Bernie
MS Excel MVP

"ToddG" wrote in message
...
Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all your

code, and we can give
you some pointers as to how to re-write without using

select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in

message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd



.





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Selecting range question

Todd,

Oops, forgot to fully qualify the key range:

Sheets("TEST").Range("A1:F15").Sort _
Key1:=Sheets("TEST").Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom

HTH,
Bernie
MS Excel MVP

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Todd,

Sheets("TEST").Range("A1:F129").Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


HTH,
Bernie
MS Excel MVP

"ToddG" wrote in message
...
Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all your

code, and we can give
you some pointers as to how to re-write without using

select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in

message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd


.





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Selecting range question

Don,

You forgot the same thing that I did: the key needs to be

Sheets("Test").Range("F2")

if Test is not the activesheet.

Bernie
MS Excel MVP

"Don Guillett" wrote in message
...
try from ANYWHERE.
Sheets("TEST").Range("A1:F129").Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


--
Don Guillett
SalesAid Software

"ToddG" wrote in message
...
Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all your

code, and we can give
you some pointers as to how to re-write without using

select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in

message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd


.







  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Selecting range question

That did it...thanks to you both


-----Original Message-----
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd
.

  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Selecting range question

I know. I caught it as just after I touched the send button. Thanks

--
Don Guillett
SalesAid Software

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Don,

You forgot the same thing that I did: the key needs to be

Sheets("Test").Range("F2")

if Test is not the activesheet.

Bernie
MS Excel MVP

"Don Guillett" wrote in message
...
try from ANYWHERE.
Sheets("TEST").Range("A1:F129").Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


--
Don Guillett
SalesAid Software

"ToddG" wrote in message
...
Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all your
code, and we can give
you some pointers as to how to re-write without using
select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote in
message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd


.







  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Selecting range question

Was JUST going to ask you about that. Works just fine now.
Thanks a million
-----Original Message-----
Todd,

Oops, forgot to fully qualify the key range:

Sheets("TEST").Range("A1:F15").Sort _
Key1:=Sheets("TEST").Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom

HTH,
Bernie
MS Excel MVP

"Bernie Deitrick" <deitbe @ consumer dot org wrote in

message
...
Todd,

Sheets("TEST").Range("A1:F129").Sort Key1:=Range("F2"),

_
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


HTH,
Bernie
MS Excel MVP

"ToddG" wrote in

message
...
Hi Bernie,

Here is a simple example:

Sheets("TEST").Select
Range("A1:F129").Select
Selection.Sort Key1:=Range("F2"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom


-----Original Message-----
Todd,

You rarely ever need to select anything: post all

your
code, and we can give
you some pointers as to how to re-write without using
select.

HTH,
Bernie
MS Excel MVP

"ToddG" wrote

in
message
...
I have the following code to select a range:

Sheets("TEST").Select
Range("A1:F129").Select

Is there a way to select this range WITHOUT first
selecting the sheet? I'd like to speed up my macro

and
thought this would be a good place to start.

I tried:

Sheets("TEST").Range("A1:F129")

and I get an error.

TIA, Todd


.





.

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
VBA question about selecting worksheets jlclyde Excel Discussion (Misc queries) 3 April 17th 08 04:39 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Yet another Newby question about selecting TBA[_2_] Excel Programming 3 August 24th 03 02:04 AM
Beginner question about selecting a range TBA[_2_] Excel Programming 3 August 15th 03 01:52 PM


All times are GMT +1. The time now is 10:30 AM.

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

About Us

"It's about Microsoft Excel"