Hi all,
I use a listbox on a userform to show the data from range B2:B300
Is there a way to select the corresponding cell of the item selected in the listbox?
Hi all,
I use a listbox on a userform to show the data from range B2:B300
Is there a way to select the corresponding cell of the item selected in the listbox?
Last edited by Jonathan78; 03-24-2011 at 08:36 AM.
Use the ListBox's ListIndex. This starts from Zero so if the data starts in A1 the ListIndex+1, etc
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
I'm not familiar with the ListIndex.
Would you mind taking a look at the attached sheet?
The code looks familiar.
The ListBox already has code to populate the textboxes based on clicking it
But it doesn't work![]()
What doesn't work, it looks like it's working to me.
What exactly are you trying to do?
When the delete button is hit on the userform, it delete's the wrong item.
I'd like it to delete the selected item on the listbox
Hello royUK,
I found the anwer on another thread, funny enough, given by you![]()
![]()
Dim I As Long With Me.ListBox1 For I = .ListCount - 1 To 0 Step -1 If .Selected(I) Then Sheets("DATA").Rows(I + 1).EntireRow.Delete Next I End With
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks