Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include quotes in a string vba

Tags:

string

excel

vba

I want to store the following text

"Test1":"Monday","Test_Abcdef":":"

All including quotes in a string

I understand that to include a quote in a string I have to include "" before a " but here it's not a very good solution as I have too many of them in a text.

Any Idea how I can do it all at once?

like image 363
Stupid_Intern Avatar asked Oct 16 '25 20:10

Stupid_Intern


1 Answers

You have two choices: you can either use two instances for each one, e.g.

"Test1"":""Monday"",""Test_Abcdef"":"":"

or you can use Chr(34):

"Test1" & Chr(34) & ":" & Chr(34) & "Monday" & Chr(34) & "," & Chr(34) & "Test_Abcdef" & Chr(34) & ":" & Chr(34) & ":"
like image 135
rory.ap Avatar answered Oct 18 '25 16:10

rory.ap