+ Reply to Thread
Results 1 to 3 of 3

Formula with single quote and sheetname

  1. #1
    Registered User
    Join Date
    02-26-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Formula with single quote and sheetname

    Hi I need to write below formula in cell but its not working correctly:

    ='ProjectName_Regression Test'!E7

    I am trying below code. Sheetname is a variable with value "ProjectName_Regression Test"
    cells(1,1).formula = "=" & Chr$(34) & sheetname & Chr$(34) & "!E7"

    Kindly Let me know what is wrong with this formula.

  2. #2
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    328

    Re: Formula with single quote and sheetname

    I think you need Chr(39) for single quote

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula with single quote and sheetname

    im not sure what you are attempting
    but
    maybe =INDIRECT("'"&B1&"'!e7") where b1 contains the sheet name
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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