Tags: cells, code, craeted, double, enter, excel, formula, fri, line, microsoft, msdn, quotes, software, string, value, vba, worka, worka4, worksheets

double quotes around string in formula craeted in vba

On Microsoft » Microsoft Excel

3,049 words with 4 Comments; publish: Fri, 23 May 2008 08:47:00 GMT; (306155.27, « »)

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 Comments

Leave a comment...

  • 4 Comments
    • 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

      >

      >

      >.

      >

      #1; Fri, 23 May 2008 08:49:00 GMT
    • 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

      #2; Fri, 23 May 2008 08:50:00 GMT
    • 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" <tegger.excel.todaysummary.com.legs.com> wrote in message

      news:es6jwlCsDHA.2224.excel.todaysummary.com.TK2MSFTNGP09.phx.gbl...

      > 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; Fri, 23 May 2008 08:51:00 GMT
    • Thank you. That did the trick.

      A very elegant solution if I may say so.

      DL

      "Tom Ogilvy" <twogilvy.excel.todaysummary.com.msn.com> wrote in message

      news:vrs722la4p8ba7.excel.todaysummary.com.news.supernews.com...

      > 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" <tegger.excel.todaysummary.com.legs.com> wrote in message

      > news:es6jwlCsDHA.2224.excel.todaysummary.com.TK2MSFTNGP09.phx.gbl...

      > > 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

      > >

      > >

      > >

      > >

      >

      #4; Fri, 23 May 2008 08:52:00 GMT