Double quotes character string

Philosophaie

Active Member
Joined
Mar 5, 2010
Messages
256
I want to add a double quote to a string. I know it has a character string name like chr45. It looks like:

a=chr45 & "String1" & chr45

which produces

"String1"

except chr45 is not the correct character string.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I want to add a double quote to a string. I know it has a character string name like chr45. It looks like:

a=chr45 & "String1" & chr45

which produces

"String1"

except chr45 is not the correct character string.

Quick guess: a=chr(34) & "String1" & chr(34)
 
Last edited:
Upvote 0
Hi,

I think you need CHAR(34) or VBA Chr(34).

One quick way to figure out what code to use is enter =CHAR(ROW()) in A1 and drag down as far as necessary with the rows being the code and the cell showing the associated character.
 
Last edited:
Upvote 0
Hi,

I think you need CHAR(34).

One quick way to figure out what code to use is enter =CHAR(ROW()) in A1 and drag down as far as necessary with the rows being the code and the cell showing the associated character.

If using in an Excel cell, Char(34) is correct....in VBA Chr(34) is correct. :)
 
Upvote 0
Try, for example
Code:
range("A1").Value=Chr(34) & "String" & Chr(34)
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top