Thread: Sort Macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tim Coddington Tim Coddington is offline
external usenet poster
 
Posts: 94
Default Sort Macro

Perhaps the expression 'activecell.End(xlDown).Row' would be of some help.
This would return the row number at the bottom of the range. You could then
build a range expression to include the entire area.

"CamEns " wrote in message
...
I'm having trouble creating a macro that will sort a column of values.
There is information in the first few rows that should not be sorted,
and totals and other information in rows after the data that should
also not be sorted.

To manually do the command I would anchor the start of the range and
use the 'down arrow' and then the 'end' key. How do I do that in a
macro?

The problem is that rows in the middle of the range are always being
added or deleted so it is a dynamic range. I had no success with the
offset command as it doesn't (or didn't the way I was using it) work
when you have data below the list that can't be part of the range.

Any ideas?


---
Message posted from http://www.ExcelForum.com/