sorting rows wich can vary in number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Im working on a standard excel sheet wich is going to be used in many
projects. Because of this de row count can vary.
I have to do sort functions in these rows, therefor i made a macro and
copied this macro under a commandbutton. This works perfectly. BUT how can I
make something like this with a variable row count???

Thanks in advance....
 
I thought of that, but there is a sommation and more calculations below to
lowest input row
like this simplified list :

1 15 \
2 20 rows that have to be sorted
3 25 /
--------- +
6 60
 
In your macro, calculate the range

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
Set myRange = Range("A1", Cells(clastrow-2,"B") ' allow for sum line and
dashes line

and sort myRange. Obviously adjust the cells to your data

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top