View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
confused guy and desperately in need ! confused guy and desperately in need ! is offline
external usenet poster
 
Posts: 12
Default code for sorting data

thanks dear Mattew for your reply,
actually i have used it but that way you get empty cells in between , if the
word starts say with "co" it should be in one column but for others that cell
will return empty , right? that is exactly what i should not do, so if the
words begining with "co" on main column are in rows 1, 5, 12, 17 , 23 , they
should be in my new sorted column just in cells 1,2,3,4,5 , i think i need
macro really dont you think so ?

Best wishes,
MM
"Matthew Pfluger" wrote:

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