![]() |
double quotes around string in formula craeted in vba
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 |
double quotes around string in formula craeted in vba
This should do it.
Worksheets(3).Cells(r, x).Value = "=Work!A" & r & " & ""Fri Night""" -----Original Message----- 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 . |
double quotes around string in formula craeted in vba
tegger wrote:
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""" -- Steve Garman |
double quotes around string in formula craeted in vba
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" -- Regards, Tom Ogilvy "tegger" wrote in message ... 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 |
double quotes around string in formula craeted in vba
Thank you. That did the trick.
A very elegant solution if I may say so. DL "Tom Ogilvy" wrote in message ... 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" -- Regards, Tom Ogilvy "tegger" wrote in message ... 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 |
All times are GMT +1. The time now is 09:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com