how to sort many rows independently?
turn on the macro recorder
select a single row or subset of a row
Select Sort, in the sort dialog, select the options button and select left
to right
finish the sort.
Turn off the macro recorder.
then it will be something like
set rng = selection
for each cell in rng.columns(1).Cells
cell.resize(1,20).sort - rest of recorded code
Next
--
Regards,
Tom Ogilvy
"guillemot" wrote
in message ...
Repost from Misc. forum. Maybe it belongs over here instead:
Hello all,
I have a large dataset in excel that I need to sort and rank by
abundance. It includes information on the abundances of each of 154
different plant species at each of eight locations, during six
different sampling periods (3 years, fall and spring) with twenty
replicates per site (plot number). There are separate site, season,
year, and plot columns to identify individual records, as well as one
column for each species.
I need to create rank-abundance profiles for each replicate site during
each sampling period. For further clarification on what these are, do a
google search for "species rank abundance plot". There is an image that
comes up and many web pages that explain the concept. To do this, I need
to sort the species data in each row by rank-within-row from most
abundant to least abundant from left to right. There will be a lot of
zeros on the right since most plots only have 5 - 20 of the 154 species
in them. The abundance values don't need to be linked with the species
name headers anymore. I hope that part was clear.
Then I want to calculate the proportion of of the row total abundance
that each species contributes. Then (it goes on), I want to calculate
mean rank-abundance profiles for each site by sampling date
combinations by averaging across the 20 replicate plots. I want to do
this part twice - once with the proportion data, and once with the raw
data. Here's how the data is organized. There are 960 rows:
Site Season Year Plot# Species1 Sp2 Sp3 Sp4.... Sp154
A Spring 2003 1 0 5 2 15
A Spring 2003 2 5 0 1 3
|