• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 478
  • Last Modified:

Double-Click ListBox entry - assign result to a variable

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
ShowOpenWorkbooks.xlsm
0
David Phelops
Asked:
David Phelops
1 Solution
 
KyleSWCommented:
How about:
Private Sub Lbx_OpenWorkbooks_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Workbooks(Me.Lbx_OpenWorkbooks.Column(0)).Activate
    Unload Me
End Sub

Open in new window

0
 
David PhelopsAuthor Commented:
Thanks - another link in the chain!

Cheers
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now