+ Reply to Thread
Results 1 to 7 of 7

Listbox in User form, selecting a column only of a row.

  1. #1
    Registered User
    Join Date
    07-14-2020
    Location
    Kerala, India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    29

    Listbox in User form, selecting a column only of a row.

    Dear friends,

    I have added a listbox in my user form, which is a multi-column one. I would like to select an item of the list box, not the entire row when I click a column / row of the listbox. Is it possible to change to style of listbox to select an item and not the entire row of items?

    Regards,
    Pravin Kumar.

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

    Re: Listbox in User form, selecting a column only of a row.

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    07-14-2020
    Location
    Kerala, India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    29

    Re: Listbox in User form, selecting a column only of a row.

    Dear torachan,

    I hope that the post is clear enough. As you suggested, I can add a workbook generating a user form with a multi-column listbox, which on selection, selects the entire row of the list items. I am not sure how that will help. What I want is selecting a column of the list item row, where the mouse has clicked.

    I am sure that somewhere some listbox settings I am missing. I thought that some experts can suggest that.

    Regards,
    Pravin Kumar.

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

    Re: Listbox in User form, selecting a column only of a row.

    The reason behind asking for an actual file enables us to work within your actual case.
    Excel is very broad and there are numerous methods to achieve the same end.
    it is counter productive to suggest a method that conflicts with the rest of your code.
    My personal preference is to work with tables and arrays to populate combos/listboxes.
    Rowsource is a method I rarely use due to its instability when used with large amounts of data transference.
    A simple example file is attached, you will see in the code the transfer of each element of the listbox choice to individual textboxes.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-14-2020
    Location
    Kerala, India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    29

    Re: Listbox in User form, selecting a column only of a row.

    Thanks Torachan for your detailed reply. Though my post remains unanswered, your reply helped to clear some grey areas of my understanding.

    Special thanks for the example file you had posted. My question was not about populating a multi-column listbox but selecting an item of the listbox (not a complete row but the row and column where the user clicks).

    Attachment 700959

    In the example file you had posted, I want to select only the date value when I click the sixth column of any row. Is it possible? Can we style the listbox while designing to have this ability?

    Regards,
    Pravin Kumar.

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

    Re: Listbox in User form, selecting a column only of a row.

    your attachment is shown as invalid - the paperclip does not work - follow the big yellow banners instructions.
    you cannot directly select the individual column in the listbox.
    the row is selected and by code you will have to seperate the elements of the row.
    this is what is happening in the example by using the listbox.listindex to reference back to the cells populating the listbox

  7. #7
    Registered User
    Join Date
    07-14-2020
    Location
    Kerala, India
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    29

    Re: Listbox in User form, selecting a column only of a row.

    OK. I understand.
    Thanks.

+ 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. How to get User Form Controltiptext to appear without selecting the user form?
    By superlative in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-26-2019, 06:33 AM
  2. User Form ListBox - Find Records (ListBox Populating Issue)
    By LONeillSSC in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-20-2015, 12:06 PM
  3. [SOLVED] User Form ListBox Column Widths - How to set widths for unknown number of columns
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2013, 05:24 AM
  4. [SOLVED] How can I active a row from a listbox in a user form?
    By Magma310 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-07-2013, 03:42 PM
  5. Listbox Update on user form
    By Irish_Griffin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2009, 02:41 PM
  6. Functional Listbox in User Form
    By warby23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2009, 05:17 AM
  7. populating a listbox on a user form?
    By lrhodes in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2006, 07:05 PM

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