Dropdown menue, if new item how to ask for all credentials

RAMatgreenleaf

Board Regular
Joined
Sep 23, 2005
Messages
84
Ok,
so i have a drop down menue, it has a list off all the plants, and there corresponding prices
now i have a button that when i press it, it runs a macro which clears the validification of the cell so i can type in a new plant that is not on the list

how can i make it so when i press the macro button, it asks me in a popup for the name of the plant and its price, and then takes that info, and puts it in my list of where my drop down menu takes its info from? so that it is avaliable for later use?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

rs2k

Well-known Member
Joined
Aug 15, 2004
Messages
1,413
This is the way I have one set up.
On sheet1 in col A I have the list (for this example; named range 'Plants')place this code in the 'Refers To' box
=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A),1)

Create a userform to add your plants, and place this code on a button (Add to Plant List (?))

Private Sub cmdAddtoPlants_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
'find first empty row in database
irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(irow, 1).Value = Me.textbox1.Value
'clear the data
Me.textbox1.Value = ""
End Sub

You may have to amend the range, but it should get you started.

Colin.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,118
Messages
5,835,492
Members
430,359
Latest member
ManuelCukRia

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
Top