Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Sort Contents of Moving Range

I haven't been able to pull different topics together to find a
concrete answer for this. I have a project list i am making, and i have
a macro to insert a line underneath the header(which is a range), so
users basically just keep inserting rows on and on. The sheet allows
for 2 different "sort criteria". I have the sort macro in place, and
currently have users highlighting the content and hitting the button to
sort their entries. What i would like to do is have excel go from the
header range, look down until it finds and empty cell, then look right
until it finds an empty cell, and automatically select the cells with
contents so that then it can sort itself with one click and no need to
highlight. I know this is possible i just don;t know how to incorporate
excels look for blank logic. Thanks for any help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort Contents of Moving Range

Range("B10").CurrentRegion

Change B10 to the top left corner of your data.

To test it do

Range("B10").CurrentRegion.Select

does that get what you want?

If you want to include headers and there is a blank row below the header
(headers in row 1).

set rng = Range(Range("A1"), Range("A3").CurrentRegion")
rng.Select



--
Regards,
Tom Ogilvy

wrote in message
oups.com...
I haven't been able to pull different topics together to find a
concrete answer for this. I have a project list i am making, and i have
a macro to insert a line underneath the header(which is a range), so
users basically just keep inserting rows on and on. The sheet allows
for 2 different "sort criteria". I have the sort macro in place, and
currently have users highlighting the content and hitting the button to
sort their entries. What i would like to do is have excel go from the
header range, look down until it finds and empty cell, then look right
until it finds an empty cell, and automatically select the cells with
contents so that then it can sort itself with one click and no need to
highlight. I know this is possible i just don;t know how to incorporate
excels look for blank logic. Thanks for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Sort Contents of Moving Range

hi,
i'm a little confused.
go where at in the header? Cell A1?
does the range contain blanks? if i when down to an empty
cell, would that be the last row +1?
the empty cell to the right. is that the end of yoru data?
It reads like your are selecting all your data?
correct?
HDR
-----Original Message-----
I haven't been able to pull different topics together to

find a
concrete answer for this. I have a project list i am

making, and i have
a macro to insert a line underneath the header(which is a

range), so
users basically just keep inserting rows on and on. The

sheet allows
for 2 different "sort criteria". I have the sort macro in

place, and
currently have users highlighting the content and hitting

the button to
sort their entries. What i would like to do is have excel

go from the
header range, look down until it finds and empty cell,

then look right
until it finds an empty cell, and automatically select

the cells with
contents so that then it can sort itself with one click

and no need to
highlight. I know this is possible i just don;t know how

to incorporate
excels look for blank logic. Thanks for any help.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Sort Contents of Moving Range

i haven't tried any of this, looks to be the wrong idea. I can't use a
cell refrence because the rows are constantly changing because things
are being inserted. The range follows the moves therefore i wanted to
strat at the top left corner of the range and find all the data in it.
there are no blanks within the range itself.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort Contents of Moving Range

I doubt the header range moves and if it is cell A1, then

set rng = Range("A1").CurrentRegion

Then to test
rng.Select


If you fell more comfortable doing it the way you described

Set rng = Range(Range("A1"),Range("A1").End(xldown).End(xlto Right))
to test
rng.Select

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
i haven't tried any of this, looks to be the wrong idea. I can't use a
cell refrence because the rows are constantly changing because things
are being inserted. The range follows the moves therefore i wanted to
strat at the top left corner of the range and find all the data in it.
there are no blanks within the range itself.





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
Moving a range name AND Contents JMay Excel Discussion (Misc queries) 2 August 3rd 09 04:31 AM
compare the contents of one range of cells with the contents of a. Dozy123 Excel Discussion (Misc queries) 1 January 24th 07 10:14 AM
moving the contents of a cell JenBasch Excel Worksheet Functions 2 September 20th 05 03:16 AM
moving cell contents (automatically) Rusty Excel Discussion (Misc queries) 1 June 15th 05 09:01 PM
moving contents of cells based on criteria scottwilsonx[_71_] Excel Programming 1 November 12th 04 05:56 PM


All times are GMT +1. The time now is 11:12 AM.

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"