Search code examples
excelmsgboxvba

How do I insert double quote (") inside an expression of MsgBox?


I have this code having multiple use of MsgBox function. So there are few words which I want to keep it in Double Quotes ("") viz, any Brand's name and something. I'm getting an error when I simply enter the double quotes... I hope there's a way out...


Solution

  • You can double quotes to close then reopen the string.

    You can also use the msgbox function depending on waht all you have/want:

    Sub fdsa()
        Dim i As String, j As Long
        i = "Cat "
        j = Cells(1, 1).Value * Cells(1, 2).Value
        MsgBox (i & j)  
    End Sub