+ Reply to Thread
Results 1 to 6 of 6

first item in listbox does not show in listbox

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    first item in listbox does not show in listbox

    hi
    I have a uerform with combo/textboxes and listbox ,if there is only one item listed it does not show in listbox although it does in textboxes,and does not pull image up in imagebox ,have added another item to the list and now it brings it up as should do,in combobox enter cooling towers,have left this second entry in,any ideas please have tried changing listbox to 1 and 0 but nothing seems to do it
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 08-19-2013 at 10:34 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: first item in listbox does not show in listbox

    Colin

    How do we get only one item to appear?

    Coooling Towers returns 2 instances.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: first item in listbox does not show in listbox

    hi norie
    if you go to sheet1 and delete the second entry,just says cooling towers and no other info and then try again,hopefully it will show you what I mean
    it does not populate listbox with only one entry
    cheers colin

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: first item in listbox does not show in listbox

    Your code doesn't populate the listbox unless f > 1. If you want to populate anyway, I don't know why you bother with the test for f - simply call FindAll regardless.
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: first item in listbox does not show in listbox

    Colin

    I think this might be a problem.
    Please Login or Register  to view this content.
    When you step through the code f is 1 when only one instance is found so the cmdFind_Click sub will just end basically.

    Try changing 1 to 0.

  6. #6
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: first item in listbox does not show in listbox

    hi all
    thanks very much,it was the problem ,have changed it to o and works well many thanks again
    cheers colin

+ 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] Scrolling listbox to show last entered item
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-11-2012, 09:33 AM
  2. [SOLVED] Copy one listbox item to same index position in another listbox
    By Foreverlearning in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-19-2012, 06:05 AM
  3. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  4. Populate ListBox Based On Item Chosen In Another ListBox
    By davemojo82 in forum Excel General
    Replies: 1
    Last Post: 08-04-2009, 08:39 AM
  5. How to make listbox show the last item being added?
    By Ai_Jun_Zhang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2005, 12:35 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