+ Reply to Thread
Results 1 to 3 of 3

macro fails to allow function with correct syntax to be pasted in cell

  1. #1
    Registered User
    Join Date
    05-22-2015
    Location
    Arlington, Texas
    MS-Off Ver
    Excel 2007
    Posts
    2

    macro fails to allow function with correct syntax to be pasted in cell

    Howdy - First post on ANY online forum - New member with limited Excel experience but getting better the more I try.

    Running Windows7; Excel 2007 with Trust access to the VBA project object model checked.
    Below are macros used for this discussion.

    I want function results to return a Blank cell value if the function is FALSE.

    The macro “PasteFormulas1()” Pastes and processes appropriately returning a 0 (zero) when a function is FALSE.

    The macro “PasteFormulas2()” stops with a message displays stating it was stopped because of a Run-time error “1004” — Application-defined or Object-defined error. The code line with the function was highlighted in vba window.

    HOWEVER, After running the “PasteFormulas1()” macro I can either alter the function syntax that were pasted in the Worksheet to the “PasteFormulas2()” syntax
    or
    from a Text file Cut and Paste the “PasteFormulas2()” function syntax
    and the function processes correctly and return a Blank cell value if the function is FALSE.

    Thanks for any ideas as to why the “PasteFormulas2()” will not run and/or a solution.

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: macro fails to allow function with correct syntax to be pasted in cell

    put an extra set of quotes in false condition of the if function:

    Please Login or Register  to view this content.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Registered User
    Join Date
    05-22-2015
    Location
    Arlington, Texas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: macro fails to allow function with correct syntax to be pasted in cell

    Thanks, bulina2k

    The syntax change you proposed definitely worked, however, when I check the function by double clicking one of the processed cells in the Worksheet it appears with just a single set of quote characters.

    "Curiouser and curiouser", said Alice,

    Again, thanks for the solution — issue SOLVED.

+ 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. [SOLVED] Trying to find the correct syntax for a lookup function
    By freebird76 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-06-2013, 08:40 AM
  2. correct syntax for count function
    By penfold1992 in forum Excel General
    Replies: 2
    Last Post: 04-10-2012, 05:18 PM
  3. Correct Syntax for Ending Macro
    By lj123 in forum Excel General
    Replies: 1
    Last Post: 10-20-2008, 10:54 PM
  4. HELP macro function called from cell formula fails
    By mark00153 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2006, 03:32 PM
  5. Correct VBA syntax for cell function formula
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 01:05 AM

Tags for this Thread

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