+ Reply to Thread
Results 1 to 3 of 3

Meeting two conditions before proceeding with code

  1. #1
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Meeting two conditions before proceeding with code

    Hello,

    I am stuck on some code where I am trying to meet 2 conditions after pressing a button on my userform. First thing I do is press Button1 and then assign a variable to the contents I pull in to 2 textboxes.

    Please Login or Register  to view this content.
    Now, when I press Button2, I need to check 2 things:
    1. Check PC name
    2. Is TextBox1 > aVal

    So, if both conditions are TRUE then I want to call another sub.
    Please Login or Register  to view this content.
    Now this is where I am stuck... I have tried all sorts of IF statements for this.
    IF the PC name is NOT correct, but the user put more data in the textbox then I want to message them saying "Incorrect PC for updating" then exit sub.

    -OR-

    IF the PC name is not correct and the value of TextBox1 has not changed, then just continue with the code and do nothing. Hopefully I made sense explaining my issue. Thanks in advance!

    -Mike

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Meeting two conditions before proceeding with code

    Hi

    is this it?

    Please Login or Register  to view this content.
    rylo

  3. #3
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Meeting two conditions before proceeding with code

    Hi Rylo,

    I tested your code and if it is NOT the right PC it does not let me run the rest of the code if textbox1 stays unchanged. I am quite new to this but this is what I came up with today and it seems to work but seems to not be written properly.

    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)

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