+ Reply to Thread
Results 1 to 4 of 4

how to declare an If statement combined with another?

  1. #1
    Registered User
    Join Date
    08-02-2011
    Location
    stavanger, norway
    MS-Off Ver
    Excel 2003
    Posts
    29

    how to declare an If statement combined with another?

    Hi I'm stuck on this item, I'm sure it's easy to solve, but I cannot seem to find the solution..
    I have to textboxes in a form.
    The output of these boxes has to be a number.
    When clicking a commandbutton it has to check if either of the boxes has been filled out.
    They don't have to be filled out both, just one of them.

    Until now I've tried with the "If" statement, combined with "With" or with "ElseIf", but I cannot seem to figure it out.
    Can someone please point me out to the right direction?
    All help appreciated!!

    This is the code I have now (which does not do the work!)
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: how to declare an If statement combined with another?

    If either one of the text boxes needs to contain a value then your test condition is:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-02-2011
    Location
    stavanger, norway
    MS-Off Ver
    Excel 2003
    Posts
    29

    Re: how to declare an If statement combined with another?

    thanks, so easy and yet hard to find...
    regards,
    Trudie
    (Solved)

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: how to declare an If statement combined with another?

    There seemed to be a problem with this thread, so a bit late in posting
    Try
    Please Login or Register  to view this content.
    You might also want to restrict entry to these textboxes
    This will only allow numbers and decimal point (.), you might want to use a comma as your separator, change 46 to 44
    Please Login or Register  to view this content.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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