• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to remove quotation marks from a string?

shahin

Active Member
It is perhaps a childlike problem but I can't manage to solve it. What I wish to do is replace quotes from the value of Range("A1"), so that the output becomes "HI THERE" to HI THERE.

I tried like below but it doesn't allow me to put a quotation mark within quotation mark:
Code:
Sub remove_quotes()
    Dim str_val As String
    str_val = Replace(Range("A1").Value, " ", "") ''I attempted to do like """ changing the first quotation but couldn't
    MsgBox str_val
End Sub

Once again:
The value of Range("A1") = "HI THERE"

What I would like to see:
The value of Range("A1") = HI THERE
 
Last edited:
Seems to have found the solution:
Code:
Sub remove_quotes()
    Dim str_val As String
    str_val = Replace(Range("A1").Value, Chr(34), "")
    [B1] = str_val
End Sub
 
Back
Top