windbrand222
windbrand222

Reputation: 31

Enter special characters in Excel VBA

How do I enter special characters in Excel VBA? For example if I want "●" (large interpunct) in some strings, they all appear as "?". I tried to substitute all "●" with ● in VBA but it didn't work, simply displayed ● in the string.

Upvotes: 1

Views: 14720

Answers (1)

Jean-Marc Flamand
Jean-Marc Flamand

Reputation: 989

Reference Website - Unicode and VBA’s ChrW() and AscW() functions

Here the code for bullet et strong bullet. Use hexadecimal in lieu of long.

Sub DisplayBullet()
Cells(1, 1).Value = "This is a bullet - " & ChrW(8226)

Cells(2, 1).Value = "This is a strong bullet - " & ChrW(&H25CF)

End Sub

enter image description here

Important: If you try to display in a MsgBox it's not working.

Upvotes: 2

Related Questions