ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   list box (https://www.excelbanter.com/excel-discussion-misc-queries/116812-list-box.html)

enyaw

list box
 
I have a list of items in a worksheet. The worksheet uses this list via
validation to allow to have a drop down menu in some of the cells. I also
have a userform that uses this list to populate a listbox. When I open the
userform I have coding that allows me to select an item on the worksheet
using the listbox. The problem is when I close the userform and want to use
the worksheet validation cells to select an item excel jumps to the start of
the validation list.

Here is the code for the list box:
Private Sub CommandButton1_Click()
With activeworksheet
ActiveCell.Select
ActiveCell.Offset(0, 5).Select
If ActiveCell = "Yes" Then
ActiveCell.Offset(0, -1).Select
ActiveCell.ClearContents
Else
MsgBox "Cannot Reset"
End If
End With
End Sub

Private Sub CommandButton2_Click()
UserForm1.Hide
End Sub

Private Sub ListBox1_Click()
With activeworksheet
Range("Part")(UserForm1.ListBox1.ListIndex + 1).Select
End With
End Sub

Commandbutton2 closes the form
Commandbutton1 resets some information

Can anyone help?

D.

list box
 

Not sure what you mean, do you mean data validation doesn't update?


enyaw

list box
 
Its ok i figured it out.

"D." wrote:


Not sure what you mean, do you mean data validation doesn't update?




All times are GMT +1. The time now is 02:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com