+ Reply to Thread
Results 1 to 6 of 6

Disabling first row of listbox

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Disabling first row of listbox

    Greetings,
    I am using the following code to access an Userform listbox. I am needing to disable the first row from being accessed.
    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,725

    Re: Disabling first row of listbox

    First I notice that this code is for double-click. Normally you would use the click or change event to manage user selections on a listbox. How are you expecting users to use this listbox?

    Second, what do you mean by "disable the first row from being accessed"? Do you want to make it impossible for the user to click on that row? Or just ignore it if they do?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Disabling first row of listbox

    Thank you for your response.
    The users will ddb click on a row that opens a different Userform to allow for changes to be made.
    I want to make it impossible for the user to click on the first row or just ignore. Not to b able to open and modify.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,725

    Re: Disabling first row of listbox

    Add this line to your code. Nothing will happen if the user selects the first item.

    Just curious--why are you putting an item in the list box that the user can't select?
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Disabling first row of listbox

    6StringJazzer,
    Works perfectly!!!
    The reason is the first row contains an "-" for listing value.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,725

    Re: Disabling first row of listbox

    You're welcome and thanks for the rep!

+ 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. Replies: 1
    Last Post: 04-12-2022, 04:38 PM
  2. [SOLVED] Find as you type in listbox control - solution for multi-column listbox - vba dictionary
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2018, 03:42 AM
  3. [SOLVED] Show unique values in listbox and activate related cell if i select value in Listbox
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-22-2018, 06:54 AM
  4. [SOLVED] if anything in listbox select first item, if listbox empty do nothing (listbox in userform
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2015, 12:49 PM
  5. 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
  6. Replies: 12
    Last Post: 08-28-2012, 07:09 AM
  7. Disabling Items in a Listbox With Variable Entries
    By googlebot in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2008, 04:01 PM

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