Saturday 15 February 2014

Excel TreeView multi columns -


Sorry for my Nobel with Excel / Vba ... coming from a UNIX world ... help me Need!

I am trying to create a treeview with excel sheet with 3 columns in the Excel column. The magazine refers to a list of previously organized theaters in "Tree View", where A column refers to a cinema group name, B and C columns refer to special movie names and Infos, for example:

  A1: independent cinema B2: CinemaName1 C2: Cinema1 Infos B 3: CinemaName2 C 3: Cinema2 Infos B 4: CinemaName3 C 4: Cinema3 Infos A5: Cineplex cinemas B -6: CinemaName4 C6: Cinema4 Infos B7: CinemaName5 C7: Cinema5 Infos A8: C9 of the next group B9: ..... etc etc.  

After the RAN, I want to see the previewview:

  + - A1 - - + B2, C2 --- + B3, C3 --- + B4, C4 + -A5 --- B6, C6 --- B7, C7 + -A8 --- + B9, C9 etc. .  

Sorry for the lame of representation, but you get the picture ... even I have so far:

  private sub the Vrikshdrishy () as retarded range as wbBook as workbook dim wsZones Worksheet dim rngZones dim lngRows Long set wbBook = ThisWorkbook set wsZones = wbBook.Worksheets ( "Cinemas") lngRows = wsZones.Range ( "A65536") As .end (xlUp). Set rngZones = wsZones.Range ( "A1: A" & amp; lngRows) dim lElement Long Me.ZonesTree.Nodes well as limit as dim rCell We have a group name in the column "Clear TreeView control. Clear rngZones for each rCell 'so we attach it to the tree, then not rCell.Text = "" then. Add Key: = RCL Text, text: = rcl Text 'is where I block! To add nodes of children, ranges from columns 'B' and 'C' to a value in a column are required ..... Add relative: = CinemaName, _ Relationship: = TVWatch, _Key: = Cinnamonam (Here will be B column), Cinema Ifos (C column) Text: = Cinnamonam (B Column) and End with R &  

I also have it. Zonasri Linstyl = TVVRatline is in my form to start the sub-routine, which creates a check box for each element of the tree. I would like all the check boxes to choose by default ...

Is this possible? I basically need a "temporary" category in which the values ​​of BAT column are included for the construction of children's nodes ... I added some comments in the VBA code, where IM failed ... all help / suggestions Will be greatly appreciated!

Take a look at this.

Get the full range of rows from the column to to loop. Also get a range for B, C and indicate which line you are on

  Private sub-tree view () as a slow wbbook in the form of a workbook dull wsZones worksheet dim rngZones range dim lngRows long as set wbBook = ThisWorkbook set wsZones = wbBook.Worksheets ( "Cinemas") lngRows = wsZones.UsedRange.Rows.Count set rngZones = wsZones.Range ( "A1: a" & amp; lngRows) Set the range in the dim rngBC form rngBC = wsZones.Range ("B1: c & lngRows"). lngRows = wsZones.Range ( "A65536") and (xlUp) .Row 'set rngZones = wsZones.Range ( "A1: A" & amp; lngRows) dim lElement Long Range dim rOWCOUNT integer as rCell as dim With ROWCOUNT = 1 we have a group name in a column. Me.ZonesTree.Nodes' rngZones clean TreeView control for each rCell. As the 'clean', so that we do not attach it to the tree, then rCell.Text = "" Then add the .key key: = RCL.text, text: = RCL.Text 'This is where I block !!' column B and S to add to the children's nodes. There is a need for a range of ranges from one column to the next value ... Add relative: = CinemaName, _ Relation: = TVWatch, _KEY: = Cinematography (B column here), Cinefos (C column) text = Sinemanam (B column) and 'if so BC range dim currently set Rovenj as set range Turn Krenrevrenj = Aranjibisi. ROS (Panktikota) T string B = Chalurav as retarded by string dim C . Seals (, 1) c = currentRowRange.Cells (, 2) rowCount = rowCount + 1 Next RCL and and and subscription with  

No comments:

Post a Comment