+ Reply to Thread
Results 1 to 6 of 6

Trouble with getting a checkbox to place a cell value when matching the textbox.

  1. #1
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Trouble with getting a checkbox to place a cell value when matching the textbox.

    So I have a userform the has two textboxes and two checkboxes. The first textbox is the Guestname and the second is Roomnum. The two checkboxes are called MSbox and ONbox. When a user inputs the same username that is already there, the room number gets put into a separate column (up to 3 times).

    What I am having trouble with is when the MSbox is true, then it puts a M/S in column F with the corresponding name if it already there.

    Here is the current code for the MSbox:
    Please Login or Register  to view this content.
    Here is the other code I have for the textboxes (there is more code, but I left some out to simplify it, here is what I have):
    Please Login or Register  to view this content.
    I will also attach my workbook if you want to check it out.
    Attached Files Attached Files
    Last edited by Templemind; 09-15-2014 at 11:43 PM.

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Trouble with getting a checkbox to place a cell value when matching the textbox.

    Guess here's lies the problem:
    Please Login or Register  to view this content.
    The part marked red is a statement which probably always will be false and thus emptycol will always be set to 0 (=false). I don't think this line of code is like you intended.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  3. #3
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Trouble with getting a checkbox to place a cell value when matching the textbox.

    I changed it to this. I am having trouble with the other textbox now though. I fixed the last code using
    Please Login or Register  to view this content.
    The other textbox checks another column for names and decides if they match, and if they do it has a msgbox. However, after that I want it to perform the same function as the MSbox, except for in the next column "G". I know it is wrong but I am confused as to how to get it to work.
    Please Login or Register  to view this content.

  4. #4
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Trouble with getting a checkbox to place a cell value when matching the textbox.

    I think the problem is in the part below
    Please Login or Register  to view this content.
    which I think should look like this
    Please Login or Register  to view this content.
    Also this line
    Please Login or Register  to view this content.
    puts the code "O/N" in the M/S column.
    Guess this should be column 7 iso 6?

  5. #5
    Forum Contributor
    Join Date
    08-10-2014
    Location
    Alberta
    MS-Off Ver
    2016
    Posts
    128

    Re: Trouble with getting a checkbox to place a cell value when matching the textbox.

    Sorry about that. The code was riddled with errors when I gave it to you. I want it to go into the O/N column, so column 7 or "G". I fixed it by making a separate If statement. I thought I already did that, but perhaps it wasn't perfect then either. Thank you for heading me in the right direction.

  6. #6
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Trouble with getting a checkbox to place a cell value when matching the textbox.

    Glad I could help

+ 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. [SOLVED] checkbox trouble
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2014, 09:56 PM
  2. [SOLVED] populate cell with textbox value when checkbox is true on another worksheet
    By Templemind in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2014, 02:25 PM
  3. Userform to search textbox value to place other textbox values in worksheet
    By mattyh555 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2012, 11:38 AM
  4. [SOLVED] Cannot place a picture again in another textbox
    By Yogi28 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2012, 10:44 PM
  5. Matching, sorting and place in appr. cell
    By nachi in forum Excel General
    Replies: 2
    Last Post: 07-28-2011, 09:26 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