How to add a parenthesis into a string

Viewed 46
    Sub MMVol()
        Dim I As Integer
        Dim MyString As String
        Sheets("MM").Select
        Sheets("MM").Range("B2").Select
        While ActiveCell <> ""
            While ActiveCell <> ""
                MyString = MyString & ActiveCell & ","
                ActiveCell.Offset(1, 0).Select
                DoEvents
            Wend
            MyString = Left(MyString, Len(MyString) - 1)
            Sheets("WorkList Generator").Range("B2").Offset(I, 0) = MyString
            MyString = ""
            DoEvents
            If ActiveCell.Row = 10 Then ActiveCell.Offset(-8, 1).Select
            I = I + 1
        Wend
        
    End Sub

I am trying to add a parenthesis into the MyString variable so it prints the string like this "(Value of Mystring)" & "Value of Active Cell" & , so if its a bunch of 5's it will print "5","5","5","5","5","5"

1 Answers

You should escape double quote with: double quote.

MyString = MyString & """" & ActiveCell & """" & ","

"""" First and last quote are delimiters, and inside there's one quote escaped with another

Related