+ Reply to Thread
Results 1 to 8 of 8

listview box find row number

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

    listview box find row number

    hi
    I have a listview box that populates textboxes,i have put a textbox19 on the uaerform to get row number,if you enter h555 in search and click find
    there are about 12 instances of it and tb19 says row 39,which is right,but if I click any other row this goes back to zero,have tried doing a loop but this crashed the program,any ideas please,i had one for listbox that worked but seems listview is different
    cheers colin
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: listview box find row number

    Hi Colin,

    I looked at this and it's choking on:

    Please Login or Register  to view this content.
    rngRec is not Set or defined and there is no data in the first row??

    (Just a quick perusal)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

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

    Re: listview box find row number

    hi xladept
    thanks for looking,have gone through code and can not find
    Please Login or Register  to view this content.
    this at all i
    must be missing something
    cheers colin

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: listview box find row number

    It's in the Form code:

    Please Login or Register  to view this content.
    *I added the Me in front of .Controls

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

    Re: listview box find row number

    hi xladept
    found it my old eyes not as good as they were,tried to define as range but keeps stopping on
    Please Login or Register  to view this content.
    ,had gone with listview so could have 13 columns in box as opposed to listbox,wish I had nt now
    cheers colin

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

    Re: listview box find row number

    Colin

    You can have 13, or more, columns in a listbox.

    If you are having problems with that then it's probably to do with the way you are populating the listbox.

    PS Have you considered giving your controls more descriptive names?
    If posting code please use code tags, see here.

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

    Re: listview box find row number

    hi norie
    been here before norie ,yes I will do that right now
    cheers colin

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

    Re: listview box find row number

    hi norie
    this was my first option but could not get listbox to populate all 13 columns,any pointers would be good
    cheers colin
    Attached Files Attached Files

+ 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] Find match, find related cell and return that number
    By HelpHelpHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2012, 06:46 AM
  2. Listview checked row delete line in Listview and in worksheet data
    By madforit in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2012, 01:00 PM
  3. Limiting the number of characters entered into a Listview
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-25-2011, 02:10 PM
  4. Replies: 7
    Last Post: 12-18-2008, 07:34 PM
  5. Max number of item in a form (in a ListView)
    By Pierre in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2007, 07:13 AM

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