+ Reply to Thread
Results 1 to 4 of 4

Fill ListBox with specific columns from two worksheets

  1. #1
    Registered User
    Join Date
    04-27-2023
    Location
    Brazil
    MS-Off Ver
    2016
    Posts
    30

    Unhappy Fill ListBox with specific columns from two worksheets

    Hello,

    I have the code below and need to fill my ListBox with data from two sheets.

    In sheet2 there are 21 columns;
    In the sheet point is the columns H I J e Q

    But every time I run it the MsgBox "Error!" appears, can someone tell me what I am doing wrong?


    Please Login or Register  to view this content.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Fill ListBox with specific columns from two worksheets

    Starting at the beginning - your 'Set' SheetData and 'Set' Worksheet Appoint names do not reflect the actual worksheet names you have given.
    from there it is all downhill - spelling ???? SheetData then becomes sheetData (upper case 'S' becomes lower case 's')
    see big yellow banner - upload your workbook - far easier then to give you a working solution.
    Last edited by torachan; 06-04-2023 at 01:30 PM.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Fill ListBox with specific columns from two worksheets

    Hi all - I suggest you comment out or remove the first line...
    Please Login or Register  to view this content.
    ... and let VBA handle the errors normally. It will highlight the line where the error is occurring and display an error message, which might give you a clue.
    Last edited by leelnich; 06-04-2023 at 02:12 PM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Fill ListBox with specific columns from two worksheets

    @leelnich,I do not wish to sound condescending, the O.P. deserves more assistance than your suggestion.
    A brief glance at the code illustrates a need for some in depth guidance as it is nonsensical, with elementary syntax errors, 'Set' names that do not tie up with declared names, the list is extensive.
    That is why I have suggested he uploads his workbook so that we can guide him using his actual app at a 'single sitting' rather than committing to an extensive dialogue of guesses.

+ 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] populate zero in specific columns in listbox on userform when run
    By Hasson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-09-2022, 08:57 AM
  2. [SOLVED] ListBox Multiple Specific Columns Shown in UserForm
    By rmachbitz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2015, 10:46 AM
  3. Create Worksheets and fill specific cells with values
    By corneliusj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-23-2014, 09:58 AM
  4. [SOLVED] fill down specific columns with specific text
    By Excelsemi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-03-2014, 08:04 AM
  5. Fill Listbox with 2 sheet columns.
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-28-2013, 05:08 AM
  6. Showing data from specific columns in a listbox
    By Smurlos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2010, 11:13 AM
  7. ListBox Fill 3 Columns With Worksheet Range's
    By radar_jynx in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2009, 09:25 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