help with changing format in excel and then writing to file 
Author Message
 help with changing format in excel and then writing to file

I am looking to do something in excel with a big list of data I have.

I have data representing a "tree" network.  The data I have is in 2
columns, the first column has each node in it, and next to each node in
the 2nd column it has the parent.

So for example if the tree looked like:

                   /  \
                  /    \
                N3     N4

then I would have in my Excel spreadsheet:

Node      Parent
N2         N1
N3         N2
N4         N2

This is not the format I want though.  What I want to have is a text
file which has each node and next to it 1) the number of successors
                                        2) the list of sucessors

So in the above example I would want in a text file;

Node #succ  succ list
N1     1     N2
N2     2     N3 N4
N3     0
N4     0

What I have been able to do is to put the cursor on the top of the 2nd
column and insert a "filter".  This gives me a drop down box of all the
nodes that are in the 2nd column.  If I select one, eg N2, it hides all
rows except for the row with N3 and N4 in it, telling me that N3 and N4
are the children of N2.  I could write to a text file manually "N2 2 N3
N4", but some of my trees are huge and this is not practical.  Also, if
I choose N4 from the drop down list, it returns no rows, telling me that
N4 has no children.

What I want is some VB code which will;

Run through every node in the tree (ie every row in the first col),
insert that node name into the filter, run the filter, tell me how many
rows were returned (ie how many children that node had), and output that
number and the list of children to a text file.

Can someone help me with that please??????

If anyone has a better way then please tell me.  
I have never done Excel programming before.

all replies greatly appreciated



PS: please reply to email as well as group

Mon, 22 May 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. ANNOUNCE : Platform independent toolkit for writing excel file format files

2. ANNOUNCE : Toolkit for writing excel file format

3. ANNOUNCE : Toolkit for writing excel file format

4. ANNOUNCE : Toolkit for writing excel file format

5. Does Word 97 change the RTF file format in help files

6. Write a Excel File Without Excel App

7. Write to an Excel file from VB without Excel present

8. Writing Excel Files W/O Existing Excel Application

9. Writing Excel-files w/o Excel present?

10. Address format of Postal Address field when written into Word or Excel document

11. Help:Netware API Help File(in Windows Help file format)

12. Exporting Excel file to CSV formatted file.


Powered by phpBB® Forum Software