+ Reply to Thread
Results 1 to 6 of 6

check one condition, then check another condition

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    check one condition, then check another condition

    I have the below code but incapable of figuring out how to write it in vba and if its the right way to approach it:
    Please Login or Register  to view this content.
    I am trying to check if cell range 'customer' has value if not then messagebox 'please fill in name' , then proceed to check cell range 'desinger' has value, if not then messagebox 'please choose designer'
    if both cell has valuen, then proceed. when i run that code its says 'compile error 'NEXT WITHOUT FOR'

  2. #2
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: check one condition, then check another condition

    Hi chubbychub,

    If I have understood the request, the following For-Next loops must be modified as shown
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Try it and let us know

    Bye
    Max
    let's compare ideas

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: check one condition, then check another condition

    it says compile error, 'else without if'

  4. #4
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: check one condition, then check another condition

    Hi chubbychub,

    the code below is correct and does not report any errors, but I have made two lines of code comment because I do not know which libraries to associate them with or whether they are user-defined types
    Please Login or Register  to view this content.
    Try again and let me know.

    Bye
    Last edited by maxpit; 10-02-2023 at 05:10 PM.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: check one condition, then check another condition

    got it, that worked! thank you maxpit!

  6. #6
    Forum Contributor
    Join Date
    07-24-2023
    Location
    Como, Italy
    MS-Off Ver
    MSO 365 - Ver 2208
    Posts
    120

    Re: check one condition, then check another condition

    Hi chubbychub,

    you are welcome and thanks for rep.

    Bye

+ 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. Check condition ?
    By tif007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2022, 05:32 AM
  2. [SOLVED] Check dup by condition?
    By tif007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-08-2022, 10:30 AM
  3. VBA to check condition on save and do something if a condition isn't met
    By tony7262 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2016, 02:28 PM
  4. [SOLVED] VBA to check condition on save and do something if a condition isn't met
    By tony7262 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2016, 12:02 PM
  5. condition check
    By AMITKUMARVERMA in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2014, 02:03 AM
  6. [SOLVED] condition check formula Help
    By cdllt in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-26-2013, 01:23 AM
  7. Check 2 IF Condition
    By zit1343 in forum Excel General
    Replies: 3
    Last Post: 04-20-2012, 12:46 PM

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