LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
furbiuzzu
 
Posts: n/a
Default VBA: List view problem, where's the mistake?

i've written this code to obtain a list view but i cannot visualize all
data contained in my list.
everytime i launch my macro i get an "1004 run time error", i can't
understand why.
(surely because my lack of knowledge about list view & tree view
features).

the structure i want to obtain is very simple, here follow a little
scheme

A
A1
A2
..
..
..
A14
A15
B
B1
B2
..
..
..
B14
B15

etc etc etc

Actually i can visualize only 10 of my 15 categories... is this a
limitation of list view or there's someting wrong in my code...... ???

this is what i've written

Private Sub UserForm_Initialize()
Dim player1 As String
Dim player As String

With TreeView1.Nodes
.Clear
' player1 = Worksheets("team").Range("H3").Value
player1 = "Team"
.Add , , "KEY_1", player1

For i = 4 To 25
player = Worksheets("team").Range("H" & i - 1).Value
'
' add other "father-nodes"

.Add "KEY_" & i - 3, tvwNext, "KEY_" & i - 2, player
'
' add "child nodes"

.Add "KEY_" & i - 2, tvwChild, "KEY_A" & i - 2,
Worksheets("team").Range("W2").Value & ": " &
Worksheets("team").Range("W" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_B" & i - 2,
Worksheets("team").Range("X2").Value & ": " &
Worksheets("team").Range("X" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_C" & i - 2,
Worksheets("team").Range("Y2").Value & ": " &
Worksheets("team").Range("Y" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_D" & i - 2,
Worksheets("team").Range("Z2").Value & ": " &
Worksheets("team").Range("Z" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_E" & i - 2,
Worksheets("team").Range("AA2").Value & ": " &
Worksheets("team").Range("AA" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_F" & i - 2,
Worksheets("team").Range("AB2").Value & ": " &
Worksheets("team").Range("AB" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_G" & i - 2,
Worksheets("team").Range("AC2").Value & ": " &
Worksheets("team").Range("AC" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_H" & i - 2,
Worksheets("team").Range("AD2").Value & ": " &
Worksheets("team").Range("AD" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_I" & i - 2,
Worksheets("team").Range("AE2").Value & ": " &
Worksheets("team").Range("AE" & i - 1).Value
.Add "KEY_" & i - 2, tvwChild, "KEY_J" & i - 2,
Worksheets("team").Range("AF2").Value & ": " &
Worksheets("team").Range("AF" & i - 1).Value
' .Add "KEY_" & i - 2, tvwChild, "KEY_K" & i - 2,
Worksheets("team").Range("I2").Value & ": " &
Worksheets("team").Range("I " & i - 1).Value
' .Add "KEY_" & i - 2, tvwChild, "KEY_L" & i - 2,
Worksheets("team").Range("S2").Value & ": " &
Worksheets("team").Range("S" & i - 1).Value
' .Add "KEY_" & i - 2, tvwChild, "KEY_M" & i - 2,
Worksheets("team").Range("T2").Value & ": " &
Worksheets("team").Range("T" & i - 1).Value
' .Add "KEY_" & i - 2, tvwChild, "KEY_N" & i - 2,
Worksheets("team").Range("U2").Value & ": " &
Worksheets("team").Range("U" & i - 1).Value
' .Add "KEY_" & i - 2, tvwChild, "KEY_O" & i - 2,
Worksheets("team").Range("V2").Value & ": " &
Worksheets("team").Range("V" & i - 1).Value

' End If
Next i

End With

End Sub


thank for your help.

fulvio.

NB: i've other questions about this topic... but let's do it step by
step

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down list shrinks as you go down column D.Farns Excel Discussion (Misc queries) 7 March 29th 07 07:04 PM
AutoFilter list problem Jan Excel Worksheet Functions 3 April 20th 06 09:28 PM
time problem or excel mistake engin Excel Worksheet Functions 1 January 11th 06 10:46 PM
multiple select from the drop down list in excel. list in one sheet and drop down in sriramus Excel Discussion (Misc queries) 5 October 27th 05 06:55 PM
View From a drop down list Tyler Excel Discussion (Misc queries) 2 September 8th 05 06:51 PM


All times are GMT +1. The time now is 10:40 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"