P
Pete
I've got a question about a menu item I've added to the "Formula Bar"
shortcut menu. I'm trying to insert a predefined text string in the cell
when the user clicks the menu item. However, it doesn't seem that while
you're editing a formula that Excel can run any macros, so I was wondering
if anyone had any idea how to do this.
This is the code I'm trying to use:
Sub InsertPN()
strQ = Chr(34)
ActiveCell.Value = ActiveCell.Value & "$PRP:" & strQ & "DwgNo" & strQ
End Sub
And this is the code I used to create the shortcut menu item:
Sub Menu()
Set FormulaItem = CommandBars("Formula Bar").Controls.Add
With FormulaItem
.Caption = "Insert P/N"
.OnAction = "InsertPN"
.BeginGroup = True
End With
End Sub
TIA for any help.
-Pete
shortcut menu. I'm trying to insert a predefined text string in the cell
when the user clicks the menu item. However, it doesn't seem that while
you're editing a formula that Excel can run any macros, so I was wondering
if anyone had any idea how to do this.
This is the code I'm trying to use:
Sub InsertPN()
strQ = Chr(34)
ActiveCell.Value = ActiveCell.Value & "$PRP:" & strQ & "DwgNo" & strQ
End Sub
And this is the code I used to create the shortcut menu item:
Sub Menu()
Set FormulaItem = CommandBars("Formula Bar").Controls.Add
With FormulaItem
.Caption = "Insert P/N"
.OnAction = "InsertPN"
.BeginGroup = True
End With
End Sub
TIA for any help.
-Pete