+ Reply to Thread
Results 1 to 2 of 2

Nested IF recorded using macro does not work when run from VBA developer

  1. #1
    Registered User
    Join Date
    01-28-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Nested IF recorded using macro does not work when run from VBA developer

    Hi there, I am relatively new to VBA.

    I recorded a macro to insert an IF formula into a cell:

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    (I know, it's messy)

    When I use the formula manually in Excel, it works perfectly, but when I run the recorded macro it give me a run-time error '1004': Application or object-defined error.

    Anyone have a better way of doing a nested IF?

    I have to use VBA because it is a large file which is automatically updated each week.

    Thanks for your replies!
    Last edited by 6StringJazzer; 03-19-2014 at 09:22 PM.

  2. #2
    Registered User
    Join Date
    01-28-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Nested IF recorded using macro does not work when run from VBA developer

    So I managed to solve my own problem:

    I changed the code to this format:

    Please Login or Register  to view this content.

+ 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. Result of recorded macro is different from hand work
    By petrb142 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2014, 08:41 AM
  2. [SOLVED] Macro Doesn't Work Through Button, Does Work Through Developer ->Macros Option
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-27-2013, 11:55 AM
  3. Help! The recorded Macro does not work for the highlighted
    By lans_bazx in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 09-19-2012, 06:59 PM
  4. Recorded Macro Does Not Work
    By TheColorLavender in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2012, 01:56 AM
  5. How to alter a recorded macro to work better
    By antonymiller in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2009, 02:53 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