Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Should probably be (for sort key)
Sheets("TEST").range("A1:F129").Sort Key1:=sheets("test").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 . |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You probably don't need to select any but use
application.goto Sheets("TEST").Range("A1:F129") -- Don Guillett SalesAid Software "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA question about selecting worksheets | Excel Discussion (Misc queries) | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Yet another Newby question about selecting | Excel Programming | |||
Beginner question about selecting a range | Excel Programming |