-1
我一直在嘗試編碼&,如字符& chr(38),但它保留底層的單詞。任何解決方案?如何從VBA打印和從Excel到Excel
Private Sub createMenu()
'define the variables
Dim mnuDownload1 As Menu
'create the menue bar
With MenuBars(xlWorksheet)
.Reset
.Menus.Add "Import", 1
'define the menue bar
Set mnuDownload1 = MenuBars(xlWorksheet).Menus("Import")
'for each defined menu bar at the sub item , the first "" is the name of the item. The second "" is the macro name
With mnuDownload1.MenuItems
.AddMenu Caption:="P&S"
.Item("P&S").MenuItems.Add "Exclude P" & Chr(38) & "S", "changes"
End With
End With
End Sub
這是所有的代碼是完整的?正如你寫的那樣,或者用chr(38)會在msgbox中顯示「&」 – QHarr
你的代碼對我來說工作得很好。它顯示&只是你想要的。 – braX
對不起,我上面更新 – Lowpar