you add another single quote to escape your single quote inside your vim macro
let @r=':%s/''/"/g' from https://vim.fandom.com/wiki/Macros
if your register must itself contain single quote characters, you use a second single-quote character to escape it.
For example, if you want your register to contain "Vim's quote handling is a little tricky" you would type :let @a='"Vim''s quote handling is a little tricky"'