Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ok what I want to do is make a drop down menu with the same values that they
input in a different worksheet. However i dont want there to be duplicates in the drop down list if they put the same value in twice. Im going to have a userform made with a drop down list for the values they input in a previous worksheet and another field called miles that they put in themselves. When they click on commandbutton1 it will input those fields into A2 and B2 then will clear the userform to input again. If they push commandbutton2 it will end the macro. Inputworksheet: Miles Worksheet with values for dropdown: Expense (Column H) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am a little confused as to what your trying to accomplish. You want the
user to add items to a dropdown? or select from one or both? What information is going to "miles"? "Ewing25" wrote: Ok what I want to do is make a drop down menu with the same values that they input in a different worksheet. However i dont want there to be duplicates in the drop down list if they put the same value in twice. Im going to have a userform made with a drop down list for the values they input in a previous worksheet and another field called miles that they put in themselves. When they click on commandbutton1 it will input those fields into A2 and B2 then will clear the userform to input again. If they push commandbutton2 it will end the macro. Inputworksheet: Miles Worksheet with values for dropdown: Expense (Column H) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe somthing like this will get you started in the right direction. You
will need a userform, 2 command buttons a combobox and a textbox, I used you sheet names to keep it easy. HTH Option Explicit Private Sub CommandButton1_Click() Dim RW As Long Dim WS As Worksheet Set WS = Worksheets("Miles") 'Finds first empty row RW = WS.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row 'Fits columns to contents Columns("A").AutoFit Columns("B").AutoFit ' Adds Values to Worksheet "Miles" WS.Cells(RW, 1).Value = Me.ComboBox1.Value WS.Cells(RW, 2).Value = Me.TextBox1.Value ' Clears data Me.ComboBox1.Value = "" Me.TextBox1.Value = "" End Sub Private Sub CommandButton2_Click() Unload Me End Sub Private Sub UserForm_Initialize() With Me.ComboBox1 .RowSource = "Expense!H1:H10" ' Populates Dropdown from "Expense" Column H End With End Sub "Office_Novice" wrote: I am a little confused as to what your trying to accomplish. You want the user to add items to a dropdown? or select from one or both? What information is going to "miles"? "Ewing25" wrote: Ok what I want to do is make a drop down menu with the same values that they input in a different worksheet. However i dont want there to be duplicates in the drop down list if they put the same value in twice. Im going to have a userform made with a drop down list for the values they input in a previous worksheet and another field called miles that they put in themselves. When they click on commandbutton1 it will input those fields into A2 and B2 then will clear the userform to input again. If they push commandbutton2 it will end the macro. Inputworksheet: Miles Worksheet with values for dropdown: Expense (Column H) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating Drop-down menus with subset drop-down menus | Excel Worksheet Functions | |||
Drop down menus | Excel Worksheet Functions | |||
Drop Down Menus | Excel Worksheet Functions | |||
Drop down menus | Excel Programming | |||
Drop down menus | Excel Worksheet Functions |