+ Reply to Thread
Results 1 to 10 of 10

Listbox on Userform not transferring data

  1. #1
    Registered User
    Join Date
    09-04-2019
    Location
    Austin, TX
    MS-Off Ver
    2016
    Posts
    6

    Listbox on Userform not transferring data

    I would really appreciate the help. Thanks in advance!

    Attached is a picture of my userform for a visual reference. My issue is having three options to choose from on my userform to be selected and have the information be transfered into my master sheet. This is the code I have for the form currently but the only information that transfers is the "Manually entered" text box. Any suggestions?

    Userform1.PNG

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 1).Value = ListBox1.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 1).Value = ListBox2.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 1).Value = TextBox3.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 2).Value = ListBox3.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 2).Value = ListBox4.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 2).Value = TextBox16.Text

    ThisWorkbook.Worksheets("Master Sheet").Cells(lastrow + 1, 3).Value = TextBox4.Text

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Listbox on Userform not transferring data

    It's hard to work with a picture. Can you attach copy of your file (de-sensitized if necessary)?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    09-04-2019
    Location
    Austin, TX
    MS-Off Ver
    2016
    Posts
    6

    Re: Listbox on Userform not transferring data

    I'll need to de-sensitize it in order for me to post. Can I clarify any questions? I'll work on another workbook in the mean time.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Listbox on Userform not transferring data

    Many of the column references of this code are the same
    Please Login or Register  to view this content.
    The cells are being written to and over-written so that the data from the TextBoxes are the last thing written in the cells.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,026

    Re: Listbox on Userform not transferring data

    It is just easier to work with the file to test any possible solutions. You don't need to include all the data, just enough to make it representative of your actual data and how it is organized

  6. #6
    Registered User
    Join Date
    09-04-2019
    Location
    Austin, TX
    MS-Off Ver
    2016
    Posts
    6

    Re: Listbox on Userform not transferring data

    Thank you for your response.

    They reference the same column because I need to have the option to select one of the three options, and then have that data be entered into the column. Does that make sense?

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Listbox on Userform not transferring data

    If the data written to the cells depends on the option button selected, that should be written into code that writes to the sheet. What you posted will result in only the textbox entries being in the cell, no matter what option buttons are selected. (I don't see any option buttons in the picture of the userform).

  8. #8
    Registered User
    Join Date
    09-04-2019
    Location
    Austin, TX
    MS-Off Ver
    2016
    Posts
    6

    Re: Listbox on Userform not transferring data

    This may clarify my original question. I want to be able insert my data from either the listbox or the textbox. My code isnt allowing me to do this.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Listbox on Userform not transferring data

    That code tests if the user has selected "True" as the entry from a list box.
    If you want to test if the user has made a selection from a ListBox, code like this should be used.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-04-2019
    Location
    Austin, TX
    MS-Off Ver
    2016
    Posts
    6

    Re: Listbox on Userform not transferring data

    Mike - this works great! Thank you very much!

+ 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] Transferring data from multi item listbox into a cell
    By AndyMan81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-01-2014, 06:31 AM
  2. Transfer Data From One Userform Listbox to Another Userform Listbox with 11 columns
    By sparkoft in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-18-2013, 10:54 AM
  3. [SOLVED] Transferring data from listbox to listbox
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-22-2013, 03:19 AM
  4. Listbox to Listbox, no duplicates & submitting same UserForm data for each Listbox entry.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 12:18 PM
  5. Transferring ListBox Value from Userform to Cell
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2012, 08:07 AM
  6. Transferring Data from Userform Listbox to Drop-down list in Worksheet
    By f5awp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2011, 12:22 AM
  7. UserForm transferring data
    By mariapata1974 in forum Excel General
    Replies: 8
    Last Post: 03-28-2010, 11:18 AM

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