Results 1 to 4 of 4

VBA macro to put Formula in cell - too long?

Threaded View

  1. #1
    Registered User
    Join Date
    08-16-2010
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2003
    Posts
    5

    VBA macro to put Formula in cell - too long?

    Hi,

    When I try to run the below code (it should copy the formula into the cell) I get the error message "Run-time error '1004': Application-defined or object-defined error".

    Is this because it is too long? If so, how could I shorten it?

    Thank you in advance for your help!

    Range("A4").Select
        ActiveCell.FormulaR1C1 = _
            "=IF(ISERROR(IF(OR((LEFT(VALUE(RC[1]),10))=""7901699797"",(LEFT(VALUE(RC[1]),10))=""7901551774"",(LEFT(VALUE(RC[1]),10))=""7990076047"",(LEFT(VALUE(RC[1]),10))=""7990113923"",(LEFT(VALUE(RC[2]),6))=""743203"",(LEFT(VALUE(RC[2]),3))=""625"",(LEFT(VALUE(RC[2]),3))=""626"",(LEFT(VALUE(RC[2]),3)=""627"",(LEFT(VALUE(RC[2]),6))=""473203"")),"""",""delete"")),"""",IF(OR((LEFT(VALUE(RC[1]),10))=""7901699797"",(LEFT(VALUE(RC[1]),10))=""7901551774"",(LEFT(VALUE(RC[1]),10))=""7990076047"",(LEFT(VALUE(RC[1]),10))=""7990113923"",(LEFT(VALUE(RC[2]),6)=""743203"",(LEFT(VALUE(RC[2]),3))=""625"",(LEFT(VALUE(RC[2]),3))=""626"",(LEFT(VALUE(RC[2]),3)=""627"",(LEFT(VALUE(RC[2]),6)=""473203"")),"""",""delete""))"
    Last edited by mac8528; 08-16-2010 at 09:30 AM.

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