Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Can some one please help me with this line of code. I am trying to select 2
separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Sorting work on contiguous ranges.
You can sort each area separately -- or sort A10:H##. Jim Tibbetts wrote: Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Use UNION:
Set r1=range("A1:A5") set r2=range("Z1:Z100") set r3=UNION(r1,r2) -- Gary''s Student - gsnu200763 "Jim Tibbetts" wrote: Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Jim,
The code to select separate areas would be: Range("A10:E" & Range("TEAMCOUNT").Value + 9 & ",G10:H" & Range("TEAMCOUNT").Value + 9).Select BUT... you can't sort with multiple ranges selected.... Sorry. HTH, Bernie MS Excel MVP "Jim Tibbetts" wrote in message ... Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Thanks for the reply. That would work. However, I'm finding out I can't sort
multiple selections anyway. -- Jim T "Gary''s Student" wrote: Use UNION: Set r1=range("A1:A5") set r2=range("Z1:Z100") set r3=UNION(r1,r2) -- Gary''s Student - gsnu200763 "Jim Tibbetts" wrote: Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Thanks Dave.
-- Jim T "Dave Peterson" wrote: Sorting work on contiguous ranges. You can sort each area separately -- or sort A10:H##. Jim Tibbetts wrote: Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting multiple areas
Thanks Bernie. I didn't know you couldn't sort noncontiguous ranges. I'll
sort the ranges separately. -- Jim T "Bernie Deitrick" wrote: Jim, The code to select separate areas would be: Range("A10:E" & Range("TEAMCOUNT").Value + 9 & ",G10:H" & Range("TEAMCOUNT").Value + 9).Select BUT... you can't sort with multiple ranges selected.... Sorry. HTH, Bernie MS Excel MVP "Jim Tibbetts" wrote in message ... Can some one please help me with this line of code. I am trying to select 2 separate areas so they can be sorted together. Range("A10:E" & Range("TEAMCOUNT").Value + 9),"G10:H" & Range("TEAMCOUNT").Value + 9").Select It seems that no matter what I do I get an error message. -- Jim T |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting/Copying Variable Areas | Excel Programming | |||
Multiple print areas | Excel Programming | |||
Multiple plot areas | Charts and Charting in Excel | |||
Multiple Print areas in same sheet? | Excel Discussion (Misc queries) | |||
Set Multiple Print Areas | Excel Discussion (Misc queries) |