How to insert Symbol Ampersand into ButtonName in VBA

marimar02

Board Regular
Joined
May 21, 2010
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hello,

How can I insert a "&" symbol into the text of a ButtonName dialog?. My formula is set to name the button but when displayed, "P&L" becomes "PL". Here is part of the formula that I need to edit. Do I use CHAR function?

fDialog.ButtonName = "Upload selected P&L file"

Thanks for your help...
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Just a quick suggestion, don't know if it will work, but maybe put the ampersand in separate quotes "&" maybe "P"&"&"&"L", see if that works.
 
Upvote 0
Thanks BrOck. I tried it and didn't work for me. Still says PL. :(
 
Upvote 0
Hello,

How can I insert a "&" symbol into the text of a ButtonName dialog?. My formula is set to name the button but when displayed, "P&L" becomes "PL". Here is part of the formula that I need to edit. Do I use CHAR function?

fDialog.ButtonName = "Upload selected P&L file"

Thanks for your help...

Well I don't know if you tried it yet. It's chr(38)

So I guess:
"Upload selected P"& Chr(38) & "L file"
 
Upvote 0
Well I don't know if you tried it yet. It's chr(38)

So I guess:
"Upload selected P"& Chr(38) & "L file"

Hmmmm. That did not do the trick. Still get the "PL" :(

Code:
fDialog.ButtonName = "Upload selected P" & Chr(38) & "L file"
 
Upvote 0

Forum statistics

Threads
1,216,759
Messages
6,132,556
Members
449,735
Latest member
Gary_M

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top