Double-Click ListBox entry - assign result to a variable

Posted on 2012-09-11
Last Modified: 2012-09-11
In the attached file the user-form (uf_OpenWorkbooks) lists the open excel workbooks.
It instructs the user to double-click the required workbook, or cancel if the workbook is not open.

What code do I need to use to assign the double-clicked entry to the variable that will be used in the next part of the macro, I.e. activate the chosen workbook?

So far I have succeeded to activate the chosen workbook by clicking OK.

Thanks very much
Question by:David Phelops
    LVL 5

    Accepted Solution

    How about:
    Private Sub Lbx_OpenWorkbooks_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
        Unload Me
    End Sub

    Open in new window


    Author Closing Comment

    by:David Phelops
    Thanks - another link in the chain!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Title # Comments Views Activity
    SQL Update Query 23 64
    Copy Value of cell in formula 1 24
    IF OR formula Excel - multiple conditions 9 39
    Access left join query 5 16
    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now