Home » excel » excel – Typing the currency symbol for peso in VBA

excel – Typing the currency symbol for peso in VBA

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am aware that pressing and holding “alt”, then pressing “8369” on the keypad will give you the Peso currency symbol(₱). However I am not able to create this in my VBA code. Has anyone been able to create this, or a feasible workaround? (▒) this is what I got when trying it here in my question box, the other one above was a cut and paste which will not work in VBA.

How to&Answers:

Make sure you pick a font that will display unicode:

Sub Peso()
    Dim s As String, r As Range
    Set r = Range("A1")
    s = ChrW(8369)
    With r
        .NumberFormat = s & "#,##0"
        .Font.Name = "Arial Unicode MS"
    End With
End Sub

enter image description here

(pick thousands and decimal separators to suit your needs)