Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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




  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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




.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Line Feed in Formula Adds Double Quotes? CarlT Excel Worksheet Functions 3 April 9th 10 10:51 PM
Double Quotes [email protected] New Users to Excel 2 July 20th 08 12:43 PM
Double Quotes PeterM Excel Discussion (Misc queries) 5 June 17th 08 05:12 PM
displaying output of a formula to be in double quotes Mike Scala Excel Worksheet Functions 7 January 23rd 07 06:11 PM
"formula is too long" AND test for whether double-quotes are next-to text or number?? The Moose Excel Discussion (Misc queries) 2 September 14th 06 05:29 AM


All times are GMT +1. The time now is 05:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"