vba help...picking values from list

hov

New Member
Joined
Sep 8, 2011
Messages
6
I have a list of part numbers on a worksheet, with coresponding columns that say how the part is made...i.e. use steel A with steel B.

how would i create a drop down list that when a user selects a part, in the corespoinding cells next to it it displays how the part is made.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Awesome...this helped me alot. Another question, how would i make a button that when clicked it would open a file based upon the number picked from the drop down list?
 
Upvote 0
Afternoon,

Possibly something like if you are running the Macro from a Module

Rich (BB code):
dim partno as string
Dim ws As Worksheet
Dim wbook As Workbook
 
partno = Sheets("name of sheet").Cells(cell ref).Value
 
If partno = ("cell ref") Then
 
 
 
Set wbook = Workbooks.Open(Filename:="place of file to open")
 
If wbook.ReadOnly Then
        MsgBox "This file is being used by someone else please try again in a minute"
        wbook.Close False
    Else 'make sure destination file is shared.

The above should open a file of your chose depending on the cell reference. that is entered. this can be a bit pain depending on how many different parts you may need to search.

I do have a file you can look at that will allow you to automatically write the information to a sheet in a workbook as long as it is named the same way as the cell that holds the part name.
 
Upvote 0
I can send you a file that may help you if you want.

It in essence works on the cell reference ( box name on a userform ) that you want to search by. You would need to have your destination file saved as a shared file so more than 1 person can save to it at a time.

Cheers
Gavin
 
Upvote 0
thanks for the help.

on my listbox, my macro assigned to it doesnt show all the part numbers i have. i cant figure it out.

i wanted to have the button linked to the value selected in the list box. would that be possible or should i have that listbox value spit out to another cell?
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top