Results 1 to 13 of 13

Thread: Lookup using a list box

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,321
    Location

    stumped

    Jacob,
    I removed the line:

    ActiveCell.Offset(0, 3) = Worksheets("SalesCatalog").Range("H1")
    from the first listbox and that solved the problem of the script returning the track listing to the main page.

    I tried your code:

    Private Sub lstSelection_DblClick(ByVal Cancel As MSForms.ReturnBoolean) 
    MsgBox Worksheets("SalesCatalog").Range("H" & lstSelection.ListIndex + 1) 
    End Sub

    but I kinda run in to the same problem I am having with the code I'm using for double click, which is that you have to add the selection to the main page before you get a correct reading of the tracks. It is all linked to the selectionlink named range on the salescatalog sheet which is in cell E3. The code I was trying works if you add the album to the sheet and then double click on it in the main listbox. If you double click on any other artist, it just feeds the info to you that is in the selection link at the time.

    this doubleclick code is working if you first add it to the main page and then double click on it in the listbox.


    Private Sub lstSelection_DblClick(ByVal Cancel As MSForms.ReturnBoolean) 
    MsgBox Worksheets("SalesCatalog").Range("H1") 
    End Sub

    I appreciate your help, but I may just have to figure out a way to remove the last entry after looking at the tracks for that album.
    Last edited by Aussiebear; 04-29-2023 at 07:22 PM. Reason: Adjusted the code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •