+ Reply to Thread
Results 1 to 5 of 5

Inserting an extremely long IF statement.

  1. #1
    Registered User
    Join Date
    12-15-2010
    Location
    Greenville, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    60

    Talking Inserting an extremely long IF statement.

    I am not sure how to approach this matter. I am very new to the coding world and am just grasping some concepts. I have written an IF statment I need to be executed in the macro or inserted into the cell to execute. As you can see it is very lengthy and I can not get it inserted to the cell. Is there a way for this to run in the macro and just output the summed total on my spreadsheet? Any suggestions?? Any help would be greatly appreciated!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Inserting an extremely long IF statement.

    can you confirm that formula is correct - there would seem to be a few missing parentheses (and their subsequent location is quite important)

    Also, you have some text references implying Named Ranges mixed with other literal strings ("DNGR" and HARD for ex.) - can you confirm they are correct also ? (ie HARD is correct and should not be "HARD" for ex.)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Inserting an extremely long IF statement.

    As a general point - I wonder if the below will work for you ?
    (obvioulsy based on my interpretation of how I think the formula should read)

    Please Login or Register  to view this content.
    If you're looking to avoid writing the formula to the cell itself (ie calculate from within VBA) you can but I suspect we should try to iron out the formula problems first off.

    (the above is still long but approx 1/3 the length of the original)

  4. #4
    Registered User
    Join Date
    12-15-2010
    Location
    Greenville, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Inserting an extremely long IF statement.

    I did seem to miss a few of the "" around the text references. I have not been able to test the formula as a whole. Only parts of it. The formula is to big for me to test as a whole. But I will look at the problem with the parentheses as well. Sorry for the code. Like I said I am very new at this. I was asked to make a macro that will automatically create an invoice and this is the only way I could find to get the Totals from into the correct cells because each area varies per invoice. So any tips on how to go about this would be greatly appreciated!

  5. #5
    Registered User
    Join Date
    12-15-2010
    Location
    Greenville, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: Inserting an extremely long IF statement.

    Donkey,

    That worked perfectly.

+ 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