Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
TreeView in Excel VBA
Is there any way to show the list that I have on a spreadsheet (see
image) on a TreeView Control using Excel VBA? http://img135.imageshack.us/img135/6...enprintiv2.png It is nothing but a list of folders gotten from somewhere using the shell command and each folder put into 1 column of the Excel. I basically want that structure to be shown on a User form with the appropriate structure maintained...thought it may be possible using Treeview? I have never used Treeview earlier, hence I have no idea how to use it...any pointers will be greatly appreciated. Thanks much! Satish |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
TreeView in Excel VBA
Hi Andy
Thanks for the link...it was certainly very helpful. My requirement is a bit different...but it will help me at least get started...Here is my exact requirement: I want the list of folders to be displayed to the user (which I think I can work out from the sample example provided in your link)... But I want something more... I want the user to be able to delete/add/modify folders (nodes in this case). Something like the explorer in Windows, where if a user deletes a folder (node) all sub-folders (nodes within that node) must be deleted... Do let me know in case anyone has worked on something like this... thanks for reading... -Satish Andy Pope wrote: Hi, You should find Colo's explanation helpful. http://puremis.net/excel/code/080.shtml Cheers Andy wrote: Is there any way to show the list that I have on a spreadsheet (see image) on a TreeView Control using Excel VBA? http://img135.imageshack.us/img135/6...enprintiv2.png It is nothing but a list of folders gotten from somewhere using the shell command and each folder put into 1 column of the Excel. I basically want that structure to be shown on a User form with the appropriate structure maintained...thought it may be possible using Treeview? I have never used Treeview earlier, hence I have no idea how to use it...any pointers will be greatly appreciated. Thanks much! Satish |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
TreeView in Excel VBA
You just need to know which node is selected and then remove it.
Private Sub TreeView1_KeyDown(KeyCode As Integer, _ ByVal Shift As Integer) Dim nodTemp As Node If KeyCode = vbKeyDelete Then Set nodTemp = TreeView1.SelectedItem If MsgBox("Are you sure you want to delete " & _ nodTemp.Text, vbYesNo Or vbQuestion) = vbYes Then TreeView1.Nodes.Remove nodTemp.Index End If End If End Sub Cheers Andy Satish wrote: Hi Andy Thanks for the link...it was certainly very helpful. My requirement is a bit different...but it will help me at least get started...Here is my exact requirement: I want the list of folders to be displayed to the user (which I think I can work out from the sample example provided in your link)... But I want something more... I want the user to be able to delete/add/modify folders (nodes in this case). Something like the explorer in Windows, where if a user deletes a folder (node) all sub-folders (nodes within that node) must be deleted... Do let me know in case anyone has worked on something like this... thanks for reading... -Satish Andy Pope wrote: Hi, You should find Colo's explanation helpful. http://puremis.net/excel/code/080.shtml Cheers Andy wrote: Is there any way to show the list that I have on a spreadsheet (see image) on a TreeView Control using Excel VBA? http://img135.imageshack.us/img135/6...enprintiv2.png It is nothing but a list of folders gotten from somewhere using the shell command and each folder put into 1 column of the Excel. I basically want that structure to be shown on a User form with the appropriate structure maintained...thought it may be possible using Treeview? I have never used Treeview earlier, hence I have no idea how to use it...any pointers will be greatly appreciated. Thanks much! Satish |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
TreeView in Excel VBA
Thanx Andy!
Andy Pope wrote: You just need to know which node is selected and then remove it. Private Sub TreeView1_KeyDown(KeyCode As Integer, _ ByVal Shift As Integer) Dim nodTemp As Node If KeyCode = vbKeyDelete Then Set nodTemp = TreeView1.SelectedItem If MsgBox("Are you sure you want to delete " & _ nodTemp.Text, vbYesNo Or vbQuestion) = vbYes Then TreeView1.Nodes.Remove nodTemp.Index End If End If End Sub Cheers Andy Satish wrote: Hi Andy Thanks for the link...it was certainly very helpful. My requirement is a bit different...but it will help me at least get started...Here is my exact requirement: I want the list of folders to be displayed to the user (which I think I can work out from the sample example provided in your link)... But I want something more... I want the user to be able to delete/add/modify folders (nodes in this case). Something like the explorer in Windows, where if a user deletes a folder (node) all sub-folders (nodes within that node) must be deleted... Do let me know in case anyone has worked on something like this... thanks for reading... -Satish Andy Pope wrote: Hi, You should find Colo's explanation helpful. http://puremis.net/excel/code/080.shtml Cheers Andy wrote: Is there any way to show the list that I have on a spreadsheet (see image) on a TreeView Control using Excel VBA? http://img135.imageshack.us/img135/6...enprintiv2.png It is nothing but a list of folders gotten from somewhere using the shell command and each folder put into 1 column of the Excel. I basically want that structure to be shown on a User form with the appropriate structure maintained...thought it may be possible using Treeview? I have never used Treeview earlier, hence I have no idea how to use it...any pointers will be greatly appreciated. Thanks much! Satish |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stop excel from dropping the 0 in the beginning of a number? | Setting up and Configuration of Excel | |||
Excel docs not saving as excel docs | Excel Discussion (Misc queries) | |||
Open Excel 2003 from Windows Explorer | Excel Discussion (Misc queries) | |||
Need suggestions for some uses of Ms Excel | Excel Discussion (Misc queries) | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) |