+ Reply to Thread
Results 1 to 2 of 2

Transfer Textbox/Combobox Values to a Multiple Column Listbox Error381

  1. #1
    Registered User
    Join Date
    02-13-2020
    Location
    hull, england
    MS-Off Ver
    2007
    Posts
    32

    Transfer Textbox/Combobox Values to a Multiple Column Listbox Error381

    Hi

    I have a userform with lots of textboxes/combobox's. What Im trying to do is transfer these values into a multiple column listbox using the following code but I keep getting error 381.
    Could someone help where I am going wrong.
    Furthermore, I havn't got this far yet but thinking ahead, I want a separate command button that once the list box is populated, it will transfer the data in each column into the next blank row on the spreadsheet. Is this possible?

    This is the code to the first problem:

    Please Login or Register  to view this content.
    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Transfer Textbox/Combobox Values to a Multiple Column Listbox Error381

    You are getting this wrong in all sorts of ways.

    I will explain why but first lets sort your problem.

    This line is causing your error
    Please Login or Register  to view this content.
    Your code is trying to add data to a Listbox line that does not exist

    Replace that line with:

    Please Login or Register  to view this content.
    This will create line 0 so the rest of the code should work.


    Now my main bug bear is that you are making your coding so complicated that you will have issues going forward.

    I name all my controls by the column number on the database that they are stored in.

    Then you can use code like this to read and write to and from an infinite number of controls:

    Please Login or Register  to view this content.
    Or:


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ 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] Search listbox with combobox and textbox
    By waimea in forum Excel Programming / VBA / Macros
    Replies: 29
    Last Post: 03-02-2019, 04:37 AM
  2. [SOLVED] Transfer to Textbox on Userform based on Combobox selection
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2016, 07:25 AM
  3. [SOLVED] Transfer data from textbox to sheet depending on combobox
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-10-2015, 07:25 PM
  4. [SOLVED] Repeat TextBox value with ListBox Rows When transfer on sheet
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-17-2015, 03:49 AM
  5. Replies: 3
    Last Post: 11-19-2014, 02:45 PM
  6. Transfer listbox and textbox data from userform to spreadsheet
    By NellieNoggs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2014, 02:35 PM
  7. [SOLVED] excel vba filter values to listbox from combobox and save edit values in textbox
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2013, 08:42 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