+ Reply to Thread
Results 1 to 2 of 2

listview selection

  1. #1
    Registered User
    Join Date
    02-19-2017
    Location
    Adelaide, Australia
    MS-Off Ver
    16
    Posts
    19

    listview selection

    Hello, I have a slight problem when working with listview in excel 2016 user form.

    So form A (with listview control) calls form B, then form B does something and we come back to form A.
    At this point I need to requery my listview, and highlight previously selected row.
    This is my code:
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Code works fine, selects correct row, but listview doesn't reflect it. It looks like listview looses focus. Then I press tab few times, and when focus goes back to my listview, I see correct row highlighted.

    It's interesting - when I set listview property HideSelection to False, it shows correct highlighted with grrey... not blue. So it confirms that selection code works.

    I'm new to this, is this correct behaviour, how can I fix it?

    Many thanks in advance
    Last edited by 6StringJazzer; 03-24-2017 at 02:56 PM.

  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,532

    Re: listview selection

    I haven't seen this exact issue but to address this it would be most helpful to have your entire file. There are other issues that could affect what you are seeing.

    Also, I am surprised that this code does not produce an error. A listbox (I think that's what you mean by listview) is indexed starting at 0, not 1. So if you want to iterate through all items you would do this:

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Populating listview selection onto another userform
    By calldenniz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-25-2015, 04:11 AM
  2. listview
    By pmalazartnet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2015, 09:37 PM
  3. [SOLVED] ListView Mod!
    By ciapul12 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-24-2014, 10:20 AM
  4. [SOLVED] Reference ListView Selection in MsgBox
    By SAsplin in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-10-2013, 12:29 PM
  5. Listview
    By Sergio Sora in forum Non English Excel
    Replies: 0
    Last Post: 06-26-2012, 07:52 AM
  6. VBA - Can I populate a listbox from an array taken from a listview selection
    By PDIreland in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2012, 06:28 AM
  7. 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

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