double quotes around string in formula craeted in vba

T

tegger

I'm trying to enter this formula:

=Work!A4&"Fri Night"



with this line of code:

Worksheets(3).Cells(r, x).Value = "=Work!A" & r & "Fri Night"



I can't see how to get the double quotes around the Fri Night.



If anyone can help, I'd be most grateful,

DL
 
G

Guest

This should do it.

Worksheets(3).Cells(r, x).Value = "=Work!A" & r & "
& ""Fri Night"""
 
S

Steve Garman

tegger said:
I'm trying to enter this formula:

=Work!A4&"Fri Night"



with this line of code:

Worksheets(3).Cells(r, x).Value = "=Work!A" & r & "Fri Night"

Worksheets(1).Cells(r, x).Value = """=Work!A""" & r & """Fri Night"""
 
T

Tom Ogilvy

sStr = "=Work!A" & r & "&" & chr(34) & "Fri Night" & chr(34)
worksheets(3).Cells(r,x).Value = sStr


testing in the immediate window:

r = 4
? "=Work!A" & r & "&" & chr(34) & "Fri Night" & chr(34)
=Work!A4&"Fri Night"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top