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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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