View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Matthew Pfluger Matthew Pfluger is offline
external usenet poster
 
Posts: 130
Default code for sorting data

Must you use a macro? If not, why not insert a blank column and use the LEFT
function. Suppose the data is in column A, and the helper column is column
B. Then you would write:
=LEFT(A1,2)
in B1 and copy that down to your last row. Then simply sort the data set by
column B.

HTH,
Matthew Pfluger

"confused guy and desperately in need !" wrote:

Hi there

any suggestion for how is possible to sort a data in a column base on the
first two digits of the data in each cell. suppose that i have colume in
which some names are randomly put, now i would like to make new column in
different sheets and sort this random names in them in accordance with their
two begining digits. so the code on each sheet should read whole the colume
in the first sheet and see if any cell begins with these two spesific digits
then copy it in the new colume of the new sheet whithout any empty cells in
between.

should not be that difficult but i am not very much experienced to write it
done in excel, any suggestion is needed and very much welcomed.

Thanks a lot
MM