+ Reply to Thread
Results 1 to 2 of 2

posting a formula through vba inserts apostrophies

  1. #1
    Registered User
    Join Date
    10-13-2005
    Posts
    3

    posting a formula through vba inserts apostrophies

    I have a simple macro that rewrites a sumproduct formula:

    Cells(14, 5).FormulaR1C1 = "=SUMPRODUCT((Database!D4:D10003=B5)*(Database!F4:F10003=B8)*(Database!B4:B10003>=E5)*(Database!B4:B10003<=E8)*(Database!AI4:AI10003))"

    In the actual Excel cell it shows up as

    =SUMPRODUCT((Database!'D4':'D10003'='B5')*(Database!'F4':'F10003'='B8')*(Database!'B4':'B10003'>='E5')*(Database!'B4':'B10003'<='E8')*(Database!'AI4':'AI10003'))

    The cell references show up in single quotation marks.

    What am I doing wrong?

  2. #2
    Registered User
    Join Date
    10-13-2005
    Posts
    3

    Re: posting a formula through vba inserts apostrophies

    I found the problem.

    I was using .FormulaR1C1 with an A1 style formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Removing apostrophies from a string
    By cloudwalking in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2013, 07:03 PM
  2. Sumif formula that moves with inserts
    By Dial1 in forum Excel General
    Replies: 6
    Last Post: 01-10-2011, 06:20 PM
  3. Button that inserts part of a formula?
    By NewExcelUser in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2006, 03:09 AM
  4. Excel automatically inserts a formula in my sheet
    By smurrock in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-06-2006, 10:10 AM
  5. [SOLVED] Apostrophies SQL from Access
    By marcbell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2005, 10:05 AM

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