Sponsor Tree

S

Spike9458

I have a company with over 250 associates. To come into the company, a
person must be sponsored. I am working on a sponsor 'tree'. First I need to
indent a couple of spaces ... here is what it looks like right now:

Number Name
1 John Jones
2 Jane Smith
3 Don Juan
2 Jim Jones

and so on

I would like to be able to insert a cell to the left of the first 2, and two
cells to the left of the 3, and one cell to the left of the second two. The
tree branches out about 16 layers, and I need to be able to preserve who
sponsored whom. In the example, John Jones is Top Gun, and he sponsored Jane
Smith and Jim Jones, and Jane Smith sponsored Don Juan.

Any ideas?

After this, my challenge is to do it graphically, like a flow chart kind of
deal ... not sure yet.

Thanks in advance,

--Jim
 
B

Bob Phillips

Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To iLastRow
If Cells(i, "A").Value > 1 Then
Cells(i, "A").Resize(, 2).Cut Cells(i, "A").Offset(0, Cells(i,
"A").Value - 1)
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top