I still say that using Chr(34) is easier; easier to read and easier to type.try this and let me know....
Sheet2.Cells(1, 1) = """"""
the above code will insert double quotes in a cell.....
if u want to add double quotes along with string use this code:
Sheet2.Cells(i, 6) = "Sathish" & """" & tc_id & """" & "Kumar"
here tc_id mentions the variable... if the value of tc_id is 2 then the result will be as follows:
Sathish"2"Kumar
Have a good day..![]()
I still say that using Chr(34) is easier; easier to read and easier to type.
MsgBox "This is an ""example"" of what I mean!"
MsgBox "This is an " & chr(34) & "example" & chr(34) & " of what I mean!"
Private Const dQuote = """"
...
MsgBox "This is an " & dQuote & "example" & dQuote & " of what I mean!"
I think the one with the Chr(34) is easier to read and know what is going to be happening. It isn't by nature normal for people to see "" surrounding something. And again I will state it that using CHR(34) will be very explicit and easy to reproduce for users but when you start getting into some very complex strings which have a lot of double quotes to begin with it can be less confusing to use:(which of these is easier to read?)
strSQL = "Select Field1, Field2, Field3, 'Query1' As SourceQ " & _
"FROM [" & strTableName & "] " & _
"WHERE Field1 = " & Chr(34) & strData1 & Chr(34) & " And Field2=" & Chr(34) & strData2 & Chr(34) & " UNION " & _
"Select Field6, Field9, Field2, 'Query2' As SourceQ " & _
"FROM [" & strTableName2 & "] " & _
"WHERE Field6 = " & Chr(34) & strData1 & Chr(34) & " And Field9 =" & Chr(34) & strData2 & Chr(34)