+ Reply to Thread
Results 1 to 5 of 5

Double Quote Leading to Apostrophe Problem

  1. #1
    ToferKing
    Guest

    Double Quote Leading to Apostrophe Problem

    I am writing VB code lines like this:

    Range("m6").Select
    ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"

    When I go to the workbook and run this code I end up with an error in cell
    M6 telling me that I have a Name problem.

    The actual entry that is dumped into cell M6 is:

    =TEXT('L6', "0.00")

    Truly! The L6 has an apostrophe preceeding it and behind it. If I edit the
    cell and remove the apostrophes then cell M6 has the correct formula in it.

    Why are the double quotes leading to an apostrophe problem with the cell
    reference of L6? What do I need to change in my coding to make this problem
    go away?



  2. #2
    Don Guillett
    Guest

    Re: Double Quote Leading to Apostrophe Problem

    try

    Sub putvalue()
    With Range("m6")
    ..Value = Range("L6")
    ..NumberFormat = ("0.00")
    End With
    End Sub
    --
    Don Guillett
    SalesAid Software
    [email protected]
    "ToferKing" <[email protected]> wrote in message
    news:[email protected]...
    >I am writing VB code lines like this:
    >
    > Range("m6").Select
    > ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"
    >
    > When I go to the workbook and run this code I end up with an error in cell
    > M6 telling me that I have a Name problem.
    >
    > The actual entry that is dumped into cell M6 is:
    >
    > =TEXT('L6', "0.00")
    >
    > Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
    > the
    > cell and remove the apostrophes then cell M6 has the correct formula in
    > it.
    >
    > Why are the double quotes leading to an apostrophe problem with the cell
    > reference of L6? What do I need to change in my coding to make this
    > problem
    > go away?
    >
    >




  3. #3
    Norman Jones
    Guest

    Re: Double Quote Leading to Apostrophe Problem

    Hi ToferKing,

    Try:

    ActiveCell.Formula = "=TEXT(L6, ""0.00"")"


    ---
    Regards,
    Norman



    "ToferKing" <[email protected]> wrote in message
    news:[email protected]...
    >I am writing VB code lines like this:
    >
    > Range("m6").Select
    > ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"
    >
    > When I go to the workbook and run this code I end up with an error in cell
    > M6 telling me that I have a Name problem.
    >
    > The actual entry that is dumped into cell M6 is:
    >
    > =TEXT('L6', "0.00")
    >
    > Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
    > the
    > cell and remove the apostrophes then cell M6 has the correct formula in
    > it.
    >
    > Why are the double quotes leading to an apostrophe problem with the cell
    > reference of L6? What do I need to change in my coding to make this
    > problem
    > go away?
    >
    >




  4. #4
    ToferKing
    Guest

    Re: Double Quote Leading to Apostrophe Problem

    Yep, that did it! I dropped out R1C1 and the apostrophes went away.

    Thanks ever so much.

    "Norman Jones" wrote:

    > Hi ToferKing,
    >
    > Try:
    >
    > ActiveCell.Formula = "=TEXT(L6, ""0.00"")"
    >
    >
    > ---
    > Regards,
    > Norman
    >
    >
    >
    > "ToferKing" <[email protected]> wrote in message
    > news:[email protected]...
    > >I am writing VB code lines like this:
    > >
    > > Range("m6").Select
    > > ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"
    > >
    > > When I go to the workbook and run this code I end up with an error in cell
    > > M6 telling me that I have a Name problem.
    > >
    > > The actual entry that is dumped into cell M6 is:
    > >
    > > =TEXT('L6', "0.00")
    > >
    > > Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
    > > the
    > > cell and remove the apostrophes then cell M6 has the correct formula in
    > > it.
    > >
    > > Why are the double quotes leading to an apostrophe problem with the cell
    > > reference of L6? What do I need to change in my coding to make this
    > > problem
    > > go away?
    > >
    > >

    >
    >
    >


  5. #5
    ToferKing
    Guest

    Re: Double Quote Leading to Apostrophe Problem

    Thanks, Don. I will try that one too!

    Thanks ever so much.

    Christian

    "Don Guillett" wrote:

    > try
    >
    > Sub putvalue()
    > With Range("m6")
    > ..Value = Range("L6")
    > ..NumberFormat = ("0.00")
    > End With
    > End Sub
    > --
    > Don Guillett
    > SalesAid Software
    > [email protected]
    > "ToferKing" <[email protected]> wrote in message
    > news:[email protected]...
    > >I am writing VB code lines like this:
    > >
    > > Range("m6").Select
    > > ActiveCell.FormulaR1C1 = "=TEXT(L6, ""0.00"")"
    > >
    > > When I go to the workbook and run this code I end up with an error in cell
    > > M6 telling me that I have a Name problem.
    > >
    > > The actual entry that is dumped into cell M6 is:
    > >
    > > =TEXT('L6', "0.00")
    > >
    > > Truly! The L6 has an apostrophe preceeding it and behind it. If I edit
    > > the
    > > cell and remove the apostrophes then cell M6 has the correct formula in
    > > it.
    > >
    > > Why are the double quotes leading to an apostrophe problem with the cell
    > > reference of L6? What do I need to change in my coding to make this
    > > problem
    > > go away?
    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1