+ Reply to Thread
Results 1 to 4 of 4

VBA Multiple If Then with an Else statement

  1. #1
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    VBA Multiple If Then with an Else statement

    I have a list of account numbers where I need to add X days to their invoice date. I have 4 scenarios, +45 days for 1 account, +60 days for 2 accounts, +90 days for 2 accounts and +30 days for everything else. I thought I could just in put an else statement and end if but now I'm getting a compile error "next without for".

    Please Login or Register  to view this content.
    Could someone give me a hand on this?
    Last edited by mvparker79; 04-28-2015 at 03:17 PM.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: VBA Multiple If Then with an Else statement

    You need to read about including "ElseIF"

    http://www.techonthenet.com/excel/formulas/if_then.php
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: VBA Multiple If Then with an Else statement

    Have a look on next code: NOT TESTED

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Re: VBA Multiple If Then with an Else statement

    Thanks PCI!

+ 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. Replies: 7
    Last Post: 08-11-2014, 12:05 PM
  2. [SOLVED] If statement that will look among multiple criteria and generate a statement
    By liz5818 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2013, 04:12 PM
  3. [SOLVED] Multiple if/then Statement
    By Mile029 in forum Excel General
    Replies: 7
    Last Post: 09-27-2012, 08:20 PM
  4. Multiple If Statement
    By Merlin54k in forum Excel General
    Replies: 3
    Last Post: 08-27-2009, 10:52 AM
  5. IF statement using multiple variables to give multiple outcomes
    By stujordan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2009, 06:46 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