Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Place ListBox1 value in active cell 1

Status
Not open for further replies.

dcompto

Technical User
Jul 5, 2001
751
US
In Excel, I have UserForm1 containing ListBox1 which looks like:

container.gif


I figured out how to display ListBox1 when I select any cell within the range F7:F200:

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
  If Not Intersect(Target, Range("F7:F200")) Is Nothing Then
    UserForm1.Show
  End If
End Sub
But I haven't been able to figure out how to tell ListBox1 to place the selected value in the active cell.

TIA for any and all responses!
 
In the Activate event procedure of UserForm1 you may try something like this:
ListBox1.ControlSource = Application.ActiveCell.Address

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

It only took a couple of seconds for me to figure out where to access the event procedures (I'm so clueless!) then I added the code you suggested. It works great.

Thanks (and a star) for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top