ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort data with a varying range (https://www.excelbanter.com/excel-programming/438584-sort-data-varying-range.html)

scott

Sort data with a varying range
 
I need help with a code to do the following: needs to keep rows together (all
text-1 together as shown below) but sort in relation to column of my choice
(A,B,C, etc). There maybe columns added that will need to be included so it
has to read starting from A6 over right to last cell with data in row 6.
There may also be rows added so it has to read from A6 down to the FIRST
blank cell not the last (as shown below in A9).

A B C
6 text-1 text-1 text-1
7 text-2 text-2 text-2
8 text-3 text-3 text-3
9
10 Total

Thank You in advance

Don Guillett

Sort data with a varying range
 
why not just use a defined name range something like
sortrng
=offset($a$1,0,0,counta($a:$a),counta($1:$1))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Scott" wrote in message
...
I need help with a code to do the following: needs to keep rows together
(all
text-1 together as shown below) but sort in relation to column of my
choice
(A,B,C, etc). There maybe columns added that will need to be included so
it
has to read starting from A6 over right to last cell with data in row 6.
There may also be rows added so it has to read from A6 down to the FIRST
blank cell not the last (as shown below in A9).

A B C
6 text-1 text-1 text-1
7 text-2 text-2 text-2
8 text-3 text-3 text-3
9
10 Total

Thank You in advance



scott

Sort data with a varying range
 
what do I need to get this to run. I have very limited experiance with vba

"Don Guillett" wrote:

why not just use a defined name range something like
sortrng
=offset($a$1,0,0,counta($a:$a),counta($1:$1))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Scott" wrote in message
...
I need help with a code to do the following: needs to keep rows together
(all
text-1 together as shown below) but sort in relation to column of my
choice
(A,B,C, etc). There maybe columns added that will need to be included so
it
has to read starting from A6 over right to last cell with data in row 6.
There may also be rows added so it has to read from A6 down to the FIRST
blank cell not the last (as shown below in A9).

A B C
6 text-1 text-1 text-1
7 text-2 text-2 text-2
8 text-3 text-3 text-3
9
10 Total

Thank You in advance


.


Don Guillett

Sort data with a varying range
 
To do this
insertnamedefinename it sortrangetype in(or copy what I posted) into the
refers to boxOKuse that for your sorting

range("sortrange").sort...............

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Scott" wrote in message
...
what do I need to get this to run. I have very limited experiance with
vba

"Don Guillett" wrote:

why not just use a defined name range something like
sortrng
=offset($a$1,0,0,counta($a:$a),counta($1:$1))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Scott" wrote in message
...
I need help with a code to do the following: needs to keep rows together
(all
text-1 together as shown below) but sort in relation to column of my
choice
(A,B,C, etc). There maybe columns added that will need to be included
so
it
has to read starting from A6 over right to last cell with data in row
6.
There may also be rows added so it has to read from A6 down to the
FIRST
blank cell not the last (as shown below in A9).

A B C
6 text-1 text-1 text-1
7 text-2 text-2 text-2
8 text-3 text-3 text-3
9
10 Total

Thank You in advance


.




All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com