View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Daniel M[_2_] Daniel M[_2_] is offline
external usenet poster
 
Posts: 12
Default macro for shifting/combining and arranging data

I have the following data that i need to format....

"Count","ComponentName","RefDes","Value","Descript ion"
"1","24PIN LCD CONNECTOR","J2","CON_LCD",""
"1","128MEG SDRAM 32X4 ","U2","",""
"4","SMT CAP 0402 100NF","C12","100nF",""
"","SMT CAP 0402 100NF","C18","100nF",""
"","SMT CAP 0402 100NF","C30","100nF",""
"","SMT CAP 0402 100NF","C33","100nF",""

as you can see the data is formated to import into excel.

I need to be able to 1. sort the data by column x

2. if column ComponentName is the same as another row, append column RefDes
with data in other row and update column Count by one...This may already be
done most of the time. ex:
"","SMT CAP 0402 100NF","C12","100nF",""
"","SMT CAP 0402 100NF","C18","100nF",""
"","SMT CAP 0402 100NF","C30","100nF",""
output:
"3", "SMT CAP 0402 100NF", "C12,C18,C30", "100nF", ""

3. i also have to figure out what to do with column 1 (count) when it is
already summed up.
ex:
"4","SMT CAP 0402 100NF","C12","100nF",""
"","SMT CAP 0402 100NF","C18","100nF",""
"","SMT CAP 0402 100NF","C30","100nF",""
"","SMT CAP 0402 100NF","C33","100nF",""

4. I would then like to sort the data by RefDes with spaces in between
different letters..
ie:
C23
C32
space
U2
U4
U9
space
D1
D3

5. I would also like to take the RefDes info and combine it if possible..
ie:
if the combined data was C1, C2, C3
I would like the output to be: C1-C3

This is the basics of what i am currently doing manually. Any part of this
data sorting/manipulating i can accomplish will help. The data changes all
the time. Thanks for any help you can give!

daniel.