ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I list Ampersand in a caption or quotes? -- & in " " (https://www.excelbanter.com/excel-programming/432616-how-do-i-list-ampersand-caption-quotes.html)

Benjamin

How do I list Ampersand in a caption or quotes? -- & in " "
 
My code creates an excel bar. I want the ampersand character in the
tooltip text and/or caption depending on the button.
But Excel only shows extra spaces or duplicates a word and acts funny.
I know special characters usually require something or they don't display as
text.
Help?

'<<--Button 5 User Mode
' Create a button with an image on the bar and set some
' properties.
Set ComBarContrl = ComBar.Controls.Add(Type:=msoControlButton)
With ComBarContrl
'the facId line will let you choose an icon
' If you choose to use the faceId then the caption is not displayed
.FaceId = 3059
.Style = msoButtonIconAndCaption
.Caption = "User Mode"
.TooltipText = "Lock & Hide Sheets for User Mode"
'the onaction line tells the button to run a certain marcro
.OnAction = "btnUserMode.HideAllButOneSheet"
End With

Jacob Skaria

How do I list Ampersand in a caption or quotes? -- & in " "
 
Try
..TooltipText = "Lock && Hide Sheets for User Mode"

If this post helps click Yes
---------------
Jacob Skaria


"Benjamin" wrote:

My code creates an excel bar. I want the ampersand character in the
tooltip text and/or caption depending on the button.
But Excel only shows extra spaces or duplicates a word and acts funny.
I know special characters usually require something or they don't display as
text.
Help?

'<<--Button 5 User Mode
' Create a button with an image on the bar and set some
' properties.
Set ComBarContrl = ComBar.Controls.Add(Type:=msoControlButton)
With ComBarContrl
'the facId line will let you choose an icon
' If you choose to use the faceId then the caption is not displayed
.FaceId = 3059
.Style = msoButtonIconAndCaption
.Caption = "User Mode"
.TooltipText = "Lock & Hide Sheets for User Mode"
'the onaction line tells the button to run a certain marcro
.OnAction = "btnUserMode.HideAllButOneSheet"
End With



All times are GMT +1. The time now is 06:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com