#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spike9458
 
Posts: n/a
Default Sponsor Tree

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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Sponsor Tree

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)

"Spike9458" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"