+ Reply to Thread
Results 1 to 4 of 4

If Then Help with a Userform

Hybrid View

iwiman If Then Help with a Userform 12-21-2011, 11:24 AM
pike Re: Excel 2010 If Then Help... 12-21-2011, 02:59 PM
iwiman Re: Excel 2010 If Then Help... 12-22-2011, 10:37 AM
pike Re: If Then Help with a... 12-22-2011, 04:09 PM
  1. #1
    Registered User
    Join Date
    12-21-2011
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    13

    If Then Help with a Userform

    I am currently writing code for a userform in Excel 2010 using visual basic. What I have in the userform is a textbox to enter a restriction such as office or warehouse. When the command button on the userform is executed then excel distributes the information in the userform to several spreadsheets. One of the spreadsheets is a name badge for the visitor. What I am having trouble with is this:

    Currently when a restriction is entered in the userform, that same word or phrase is entered into a restrictions section on the name badge. What I want to happen though is if there is a restriction entered into the userform (anything at all) then a uppercase X will appear in the name badge spreadsheet in cell (13, 1). I have tried using if then statements but cannot seem to figure it out. Any help would be well appreciated!

    I have attached the file if you would like to see my explanation in excel with the actual file.
    Attached Files Attached Files

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Excel 2010 If Then Help with a Userform

    Hi iwiman
    welcome to the forum
    you could add a iif statment
    Cells(emptyRow, 1).Value = LastNameTextBox.Value & IIf(RestrictionsTextBox.Value <> "",  " X", "")
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    12-21-2011
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Excel 2010 If Then Help with a Userform

    pike,

    Thanks for the help! It worked great! I wasnt really sure of the IIF code so your help in this was much appreciated.

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: If Then Help with a Userform

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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