Discussion:
如何用 Excel 作出樹狀表
(时间太久无法回复)
Hyper
2005-11-03 08:51:06 UTC
Permalink
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
chijanzen
2005-11-03 09:29:02 UTC
Permalink
你好:

建議使用 Excel 內建的 [組職圖] 來試試

指向[插入]功能表,點選[資料庫圖表],在[圖表庫]方塊內選取[組職圖]
--
天行健,君子以自強不息
地勢坤,君子以厚德載物

http://www.vba.com.tw/plog/


"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
crdotlin
2005-11-03 12:59:08 UTC
Permalink
請試試treeview控件
--
http://crdotlin.vgocities.net/plog/


"chijanzen" 來函:
Post by chijanzen
建議使用 Excel 內建的 [組職圖] 來試試
指向[插入]功能表,點選[資料庫圖表],在[圖表庫]方塊內選取[組職圖]
--
天行健,君子以自強不息
地勢坤,君子以厚德載物
http://www.vba.com.tw/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
crdotlin
2005-11-04 00:45:07 UTC
Permalink
請參考
'coded by ***@2005.11.04
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control

Option Explicit

Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long

With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/


"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
Hyper
2005-11-04 03:58:10 UTC
Permalink
我想要用 excel 中的
VLOOKUP 函數

也要用下拉式的清單

雖然我會用

但要如何做樹狀式的下拉式的清單

我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出

目前我只會單階的方式
可以幫忙嗎?




"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
crdotlin
2005-11-04 06:09:01 UTC
Permalink
您好,
不錯的問題。
驗證的設定如下:
先設定好清單的名稱,再配合Indirect函數來按照左邊儲存格之值切換清單。
實例請從這裡下載:http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=TreeValidateList.zip
--
http://crdotlin.vgocities.net/plog/


"Hyper" 來函:
Post by Hyper
我想要用 excel 中的
VLOOKUP 函數
也要用下拉式的清單
雖然我會用
但要如何做樹狀式的下拉式的清單
我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出
目前我只會單階的方式
可以幫忙嗎?
"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
Hyper
2005-11-04 09:07:02 UTC
Permalink
I tried to follow what you said and try to figure out the excel file. But it
is really difficult to me to create the listing.
So my questions are
1) How to create the listing, I can create worksheet 2 but do not know how
to do next step.

2) How to set up level 1 or B2 & ITEMS step.

Please kindly teach and help me. Chinese is OK. Thanks a lot!


"crdotlin" 來函:
Post by crdotlin
您好,
不錯的問題。
驗證的設定如下:
先設定好清單的名稱,再配合Indirect函數來按照左邊儲存格之值切換清單。
實例請從這裡下載:http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=TreeValidateList.zip
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想要用 excel 中的
VLOOKUP 函數
也要用下拉式的清單
雖然我會用
但要如何做樹狀式的下拉式的清單
我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出
目前我只會單階的方式
可以幫忙嗎?
"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
crdotlin
2005-11-04 10:42:04 UTC
Permalink
先說明第2個問題
1. Mark sheet2.range(“a1:c1”)
2. Click 【插入】【名稱】【定義】填上名稱 “Level1”, for example.
3. Mark sheet1.range(“b2:b15”)
4. Click 【資料】【驗證】儲存格內允許Combobox內選擇”清單”
5. Select 來源之RefEdit then Click 【插入】【名稱】【貼上】Select “Level1”
6. Press 【確定】
Now, 第一個問題
1. 第二層的設定在來源的RefEdit控件中要輸入的是”=INDIRECT(清單名稱)”
2. 其中”清單名稱”要用到左邊儲存格之值,但因為名稱有些限制使得些直不能當名稱,因此可以自己加上字串。因此公式可能就成為=INDIRECT(B2 &
“Items”)這樣的形式。For example.
3. 從第2點可知必須將驗證清單分別取名為上一層的清單值再視需要連上一些字元。
4. 例如對於L11第二層的驗證清單名稱是”_L11”,這是我用建立的方式讓系統自動設定的,所以公式就成為=INDIRECT(“_”& B2)
請參考
--
http://crdotlin.vgocities.net/plog/


"Hyper" 來函:
Post by Hyper
I tried to follow what you said and try to figure out the excel file. But it
is really difficult to me to create the listing.
So my questions are
1) How to create the listing, I can create worksheet 2 but do not know how
to do next step.
2) How to set up level 1 or B2 & ITEMS step.
Please kindly teach and help me. Chinese is OK. Thanks a lot!
"crdotlin" 來函:
Post by crdotlin
您好,
不錯的問題。
驗證的設定如下:
先設定好清單的名稱,再配合Indirect函數來按照左邊儲存格之值切換清單。
實例請從這裡下載:http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=TreeValidateList.zip
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想要用 excel 中的
VLOOKUP 函數
也要用下拉式的清單
雖然我會用
但要如何做樹狀式的下拉式的清單
我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出
目前我只會單階的方式
可以幫忙嗎?
"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
crdotlin
2005-11-07 07:25:51 UTC
Permalink
只要設定好公式即可
當然如果仍用indirect函數請設定好名稱
例如下面連結的例子sheet1.range(“e2”)中=IF(D2<>"",INDIRECT("_" & D2),"")
對不起,我只設好L1。
L2及L3下面並未設定,若第一層選L2或L3,會有Error產生。
http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=79-TreeValidateList.zip

請參考
--
http://crdotlin.vgocities.net/plog/


"Hyper" 來函:
請問
要如何將最終選項一併帶出價錢?
"crdotlin" 來函:
Post by crdotlin
先說明第2個問題
1. Mark sheet2.range(“a1:c1”)
2. Click 【插入】【名稱】【定義】填上名稱 “Level1”, for example.
3. Mark sheet1.range(“b2:b15”)
4. Click 【資料】【驗證】儲存格內允許Combobox內選擇”清單”
5. Select 來源之RefEdit then Click 【插入】【名稱】【貼上】Select “Level1”
6. Press 【確定】
Now, 第一個問題
1. 第二層的設定在來源的RefEdit控件中要輸入的是”=INDIRECT(清單名稱)”
2. 其中”清單名稱”要用到左邊儲存格之值,但因為名稱有些限制使得些直不能當名稱,因此可以自己加上字串。因此公式可能就成為=INDIRECT(B2 &
“Items”)這樣的形式。For example.
3. 從第2點可知必須將驗證清單分別取名為上一層的清單值再視需要連上一些字元。
4. 例如對於L11第二層的驗證清單名稱是”_L11”,這是我用建立的方式讓系統自動設定的,所以公式就成為=INDIRECT(“_”& B2)
請參考
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
I tried to follow what you said and try to figure out the excel file. But it
is really difficult to me to create the listing.
So my questions are
1) How to create the listing, I can create worksheet 2 but do not know how
to do next step.
2) How to set up level 1 or B2 & ITEMS step.
Please kindly teach and help me. Chinese is OK. Thanks a lot!
"crdotlin" 來函:
Post by crdotlin
您好,
不錯的問題。
驗證的設定如下:
先設定好清單的名稱,再配合Indirect函數來按照左邊儲存格之值切換清單。
實例請從這裡下載:http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=TreeValidateList.zip
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想要用 excel 中的
VLOOKUP 函數
也要用下拉式的清單
雖然我會用
但要如何做樹狀式的下拉式的清單
我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出
目前我只會單階的方式
可以幫忙嗎?
"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
Hyper
2005-11-07 07:59:26 UTC
Permalink
請問
要如何將最終選項一併帶出價錢?


"crdotlin" 來函:
Post by crdotlin
先說明第2個問題
1. Mark sheet2.range(“a1:c1”)
2. Click 【插入】【名稱】【定義】填上名稱 “Level1”, for example.
3. Mark sheet1.range(“b2:b15”)
4. Click 【資料】【驗證】儲存格內允許Combobox內選擇”清單”
5. Select 來源之RefEdit then Click 【插入】【名稱】【貼上】Select “Level1”
6. Press 【確定】
Now, 第一個問題
1. 第二層的設定在來源的RefEdit控件中要輸入的是”=INDIRECT(清單名稱)”
2. 其中”清單名稱”要用到左邊儲存格之值,但因為名稱有些限制使得些直不能當名稱,因此可以自己加上字串。因此公式可能就成為=INDIRECT(B2 &
“Items”)這樣的形式。For example.
3. 從第2點可知必須將驗證清單分別取名為上一層的清單值再視需要連上一些字元。
4. 例如對於L11第二層的驗證清單名稱是”_L11”,這是我用建立的方式讓系統自動設定的,所以公式就成為=INDIRECT(“_”& B2)
請參考
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
I tried to follow what you said and try to figure out the excel file. But it
is really difficult to me to create the listing.
So my questions are
1) How to create the listing, I can create worksheet 2 but do not know how
to do next step.
2) How to set up level 1 or B2 & ITEMS step.
Please kindly teach and help me. Chinese is OK. Thanks a lot!
"crdotlin" 來函:
Post by crdotlin
您好,
不錯的問題。
驗證的設定如下:
先設定好清單的名稱,再配合Indirect函數來按照左邊儲存格之值切換清單。
實例請從這裡下載:http://crdotlin.vgocities.net/plog/resserver.php?blogId=1&resource=TreeValidateList.zip
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想要用 excel 中的
VLOOKUP 函數
也要用下拉式的清單
雖然我會用
但要如何做樹狀式的下拉式的清單
我先選 CPU, 會出現下拉式的清單 (Intel, AMD, Samsung, …), 我選了 Intel, 會出現下拉式的清單 (PXA,
IXP), 我選了 PXA, 會出現下拉式的清單 (255, 400), 我選了 255, 則 A 也會帶出
目前我只會單階的方式
可以幫忙嗎?
"crdotlin" 來函:
Post by crdotlin
請參考
'Purpose: TreeView簡單示例
'Requirement: Microsoft Windows Common Controls X.x(MSCOMCTL.ocx)
' ctv OLE Control module(dmocx.dll)
'Module: Userform with a TreeView control
Option Explicit
Private Sub UserForm_Initialize()
Dim nodX As Node
Dim myHwnd As Long
With Me.TreeView1
With .Nodes
.Add , , "L1", "Root"
.Add "L1", tvwChild, "L11", "1"
.Add "L1", tvwChild, "L12", "2"
.Add "L11", tvwChild, "L111", "3"
.Add "L12", tvwChild, "L121", "4"
.Add "L12", tvwChild, "L122", "5"
.Item("L122").EnsureVisible
.Item("L111").EnsureVisible
End With
.Style = tvwTreelinesPlusMinusText
End With
End Sub
--
http://crdotlin.vgocities.net/plog/
"Hyper" 來函:
Post by Hyper
我想知道如何用 Excel 作出樹狀表
例如
A有 1,2,3, 項, 選了1, 1又可以帶出4,5.6,選了5,...
請問可以嗎?
Loading...