Sub SetupMenus()'Dim MenuName As String
'Dim i As Integer, n As Integer
'n = 28
'MenuName = Sheets("Menu").Cells(1, 1).Value
Dim cMenu1 As CommandBarControl
Dim cbMainMenuBar As CommandBar
Dim iHelpMenu As Integer
Dim cbcCutomMenu As CommandBarControl
Dim cbcSubMenu As CommandBarControl
MenuBars(xlWorksheet).Menus.Add Caption:="D" & ChrW(7921) & " toán Pro 2011", before:=8
With MenuBars(xlWorksheet).Menus("D" & ChrW(7921) & " toán Pro 2011").MenuItems
'With MenuBars(xlWorksheet).Menus("&Du toán Pro 2011").MenuItems
.Add Caption:="Danh sách " & ChrW(273) & ChrW(417) & "n" & " giá các t" & ChrW(7881) & "nh", before:=1, OnAction:="Dongiacactinh"
FaceId = 59
'.Add Caption:="&Danh sách don giá các tinh ...", Before:=1, OnAction:="Dongiacactinh"
.Add Caption:="-", before:=2, OnAction:=""
.Add Caption:="T" & ChrW(7841) & "o" & " công trình m" & ChrW(7899) & "i...", before:=3, OnAction:="Congtrinh"
'.Add Caption:="&Tao cong trinh moi ...", Before:=3, OnAction:="Congtrinh"
.Add Caption:="-", before:=4, OnAction:=""
.Add Caption:="T" & ChrW(7841) & "o" & " h" & ChrW(7841) & "ng m" & ChrW(7909) & "c m" & ChrW(7899) & "i...", before:=5, OnAction:="Hangmuc"
'.Add Caption:="Tao hang muc moi ...", Before:=5, OnAction:="Hangmuc"
.Add Caption:="-", before:=6, OnAction:=""
.Add Caption:="Tra m" & ChrW(227), before:=7, OnAction:="TraMa", ShortcutKey:="Ctrl+T"
'.Add Caption:="Tra dinh muc ... CTRL+T", Before:=7, OnAction:="TraMa", ShortcutKey:="Ctrl+T"
.Add Caption:="-", before:=8, OnAction:=""
.Add Caption:="1 K" & ChrW(7871) & "t xu" & ChrW(7845) & "t" & " d" & ChrW(7921) & " toán", before:=9, OnAction:="PhantichDT"
'.Add Caption:="&1 Ket xuat du toan", Before:=9, OnAction:="PhantichDT"
.Add Caption:="2 Phân tích v" & ChrW(7853) & "t t" & ChrW(432), before:=10, OnAction:="PhantichVT"
'.Add Caption:="&2 Phan tich vat tu", Before:=10, OnAction:="PhantichVT"
.Add Caption:="3 T" & ChrW(7893) & "ng" & " h" & ChrW(7907) & "p v" & ChrW(7853) & "t t" & ChrW(432), before:=11, OnAction:="TonghopVT"
'.Add Caption:="&3 Tong hop vat tu", Before:=11, OnAction:="TonghopVT"
.Add Caption:="4 Tính chênh l" & ChrW(7879) & "ch v" & ChrW(7853) & "t t" & ChrW(432), before:=12, OnAction:="ChenhlechVT"
'.Add Caption:="&4 Tính chenh lech vat tu", Before:=12, OnAction:="ChenhlechVT"
.Add Caption:="5 Tính c" & ChrW(432) & ChrW(7899) & "c v" & ChrW(7853) & "n chuy" & ChrW(7875) & "n", before:=13, OnAction:="CuocVC"
'.Add Caption:="&5 Tính cuoc vân chuyên", Before:=13, OnAction:="CuocVC"
.Add Caption:="6 Tính c" & ChrW(432) & ChrW(7899) & "c trung chuy" & ChrW(7875) & "n", before:=14, OnAction:="CuocTC"
'.Add Caption:="&6 Tinh cuoc trung chuyên", Before:=14, OnAction:="CuocTC"
.Add Caption:="7 Tính giá tr" & ChrW(7883) & " v" & ChrW(7853) & "t t" & ChrW(432), before:=15, OnAction:="GiaVT"
'.Add Caption:="&7 Tính giá tri vât tu", Before:=15, OnAction:="GiaVT"
.Add Caption:="8 Tính " & ChrW(273) & ChrW(417) & "n giá chi ti" & ChrW(7871) & "t", before:=16, OnAction:="DongiaCT"
'.Add Caption:="&8 Tính don giá chi tiet", Before:=16, OnAction:="DongiaCT"
.Add Caption:="9 T" & ChrW(7893) & "ng h" & ChrW(7907) & "p " & ChrW(273) & ChrW(417) & "n giá d" & ChrW(7921) & " th" & ChrW(7847) & "u", before:=17, OnAction:="DongiaTH"
'.Add Caption:="&9 Tong hop don giá du thâu", Before:=17, OnAction:="DongiaTH"
.Add Caption:="10 Tính giá tr" & ChrW(7883) & " xây l" & ChrW(7855) & "p h" & ChrW(7841) & "ng m" & ChrW(7909) & "c", before:=18, OnAction:="KPhangmuc"
'.Add Caption:="&10 Tính giá tri xây lap hang muc", Before:=18, OnAction:="KPhangmuc"
.Add Caption:="-", before:=19, OnAction:=""
.Add Caption:="T" & ChrW(7893) & "ng h" & ChrW(7907) & "p kinh phí cho toàn b" & ChrW(7897) & " công trình", before:=20, OnAction:="KPcongtrinh"
'.Add Caption:="Tæng hîp &kinh phÝ cho toµn bé c«ng tr×nh", Before:=20, OnAction:="KPcongtrinh"
.Add Caption:="-", before:=21, OnAction:=""
.Add Caption:="Gi" & ChrW(7899) & "i thi" & ChrW(7879) & "u v" & ChrW(7873) & " ch" & ChrW(432) & ChrW(417) & "ng trình", before:=22, OnAction:="Huongdan"
'.Add Caption:="&Gioi thieu ve chuong trinh", Before:=22, OnAction:="Huongdan"
.Add Caption:="-", before:=23, OnAction:=""
.Add Caption:="Thoát kh" & ChrW(7887) & "i ch" & ChrW(432) & ChrW(417) & "ng trình", before:=24, OnAction:="CloseMe"
'.Add Caption:="&Thoat khoi chuong trinh", Before:=24, OnAction:="CloseMe"
End With
'menu tienich1
MenuBars(xlWorksheet).Menus.Add Caption:="Ti" & ChrW(7879) & "n ích khác", before:=9
With MenuBars(xlWorksheet).Menus("Ti" & ChrW(7879) & "n ích khác").MenuItems
.Add Caption:="1 Kh" & ChrW(7843) & "o sát " & ChrW(273) & ChrW(7883) & "a hình", before:=1, OnAction:="KhaosatDH"
'.Add Caption:="&1 Khao sát dia hình", Before:=1, OnAction:="KhaosatDH"
.Add Caption:="2 Kh" & ChrW(7843) & "o sát " & ChrW(273) & ChrW(7883) & "a ch" & ChrW(7845) & "t", before:=2, OnAction:="KhaosatDC"
' .Add Caption:="&2 Khao sát dia chât", Before:=2, OnAction:="KhaosatDC"
.Add Caption:="-", before:=3, OnAction:=""
.Add Caption:="3 Tính toàn b" & ChrW(7897) & " d" & ChrW(7921) & " toán theo " & ChrW(273) & ChrW(417) & "n giá chi ti" & ChrW(7871) & "t", before:=4, OnAction:="TinhDTCT"
'.Add Caption:="&3 Tính toàn bô du toan theo don giá chi tiet", Before:=4, OnAction:="TinhDTCT"
.Add Caption:="4 Tính toàn b" & ChrW(7897) & " d" & ChrW(7921) & " toán theo " & ChrW(273) & ChrW(417) & "n giá t" & ChrW(7893) & "ng h" & ChrW(7907) & "p", before:=5, OnAction:="TinhDGTH"
'.Add Caption:="&4 Tinh toan bo du toan theo don gia tong hop", Before:=5, OnAction:="TinhDGTH"
.Add Caption:="-", before:=6, OnAction:=""
.Add Caption:="Các tùy ch" & ChrW(7885) & "n", before:=7, OnAction:=""
'.Add Caption:="C¸c tuú chän ", Before:=7, OnAction:=""
.Add Caption:="-", before:=8, OnAction:=""
.Add Caption:="A Ch" & ChrW(7885) & "n ki" & ChrW(7875) & "u phân tích v" & ChrW(7853) & "t t" & ChrW(432), before:=9, OnAction:="PhantichVTngang"
'.Add Caption:="&A Chän kiÓu ph©n tÝch vËt t ...", Before:=9, OnAction:="PhantichVTngang"
.Add Caption:="B Ch" & ChrW(7885) & "n ki" & ChrW(7875) & "u phân tích " & ChrW(273) & ChrW(417) & "n giá chi ti" & ChrW(7871) & "t", before:=10, OnAction:="KieuDongiaCT"
'.Add Caption:="&B Chän kiÓu ph©n tÝch ®¬n gi¸ chi tiÕt ...", Before:=10, OnAction:="KieuDongiaCT"
.Add Caption:="C Ch" & ChrW(7885) & "n ki" & ChrW(7875) & "u tính chênh l" & ChrW(7879) & "ch v" & ChrW(7853) & "t t" & ChrW(432) & "...", before:=11, OnAction:="KchenhlechVT"
'.Add Caption:="&C Chon kieu tinh chenh lech vat tu ...", Before:=11, OnAction:="KchenhlechVT"
.Add Caption:="-", before:=12, OnAction:=""
.Add Caption:="S" & ChrW(7917) & "a các file DBF", before:=13, OnAction:="SuaDBF"
'.Add Caption:="&Sua cac File DBF ...", Before:=13, OnAction:="SuaDBF"
.Add Caption:="-", before:=14, OnAction:=""
.Add Caption:="H" & ChrW(432) & ChrW(7899) & "ng d" & ChrW(7851) & "n s" & ChrW(7917) & " d" & ChrW(7909) & "ng", before:=15, OnAction:="DangkySD"
'.Add Caption:="&Huong dan su dung", Before:=15, OnAction:="DangkySD"
.Add Caption:="Máy tính Casio", before:=16, OnAction:="Vn570MS"
.Add Caption:="L" & ChrW(7883) & "ch b" & ChrW(7887) & " túi", before:=17, OnAction:="lichthang"
'menu tien ich 2
'MenuBars(xlWorksheet).Menus.Add Caption:="Ti" & ChrW(7879) & "n ích v" & ChrW(259) & "n phòng", before:=10
'With MenuBars(xlWorksheet).Menus("Ti" & ChrW(7879) & "n ích v" & ChrW(259) & "n phòng").MenuItems
'.Add Caption:="1 " & ChrW(272) & ChrW(7885) & "c s" & ChrW(7889) & " thành ch" & ChrW(7919), before:=1, OnAction:="OpenDocSo"
'.Add Caption:="2 Chuy" & ChrW(7875) & "n ch" & ChrW(7919) & " hoa ch" & ChrW(7919) & " th" & ChrW(432) & ChrW(7901) & "ng", before:=2, OnAction:="OpenUniCase"
'.Add Caption:="3 Chuy" & ChrW(7875) & "n mã", before:=3, OnAction:=" ChuyenMa"
'.Add Caption:="4 Tách ghép h" & ChrW(7885) & " tên", before:=4, OnAction:=" OpenHoTen("
'End With
'With CommandBars("Worksheet Menu Bar").Controls(Application.ActiveWorkbook.Worksheets("Menu").Cells(1, 4).Value)
'For i = 1 To n
'.Controls(i).FaceId = Sheets("Menu").Cells(i + 1, 3).Value
' Next
End With
End Sub
Sub DeleteMenus()
For Each MenuName In MenuBars(xlWorksheet).Menus
If MenuName.Caption = Application.ActiveWorkbook.Worksheets("Menu").Cells(1, 4).Value Then
MenuName.Delete
End If
' If MenuName.Caption = "&TiÖn Ých kh¸c" Then
' MenuName.Delete
' End If
Next
End Sub