Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default drop down menus

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default drop down menus

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default drop down menus

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Drop-down menus with subset drop-down menus Benjamin Excel Worksheet Functions 4 June 8th 09 11:27 PM
Drop down menus Emerald1170 Excel Worksheet Functions 1 April 30th 09 06:20 PM
Drop Down Menus IainM21 Excel Worksheet Functions 2 June 13th 08 04:56 PM
Drop down menus [email protected] Excel Programming 2 April 17th 07 03:40 PM
Drop down menus Dannigirl426 Excel Worksheet Functions 3 January 12th 07 06:55 PM


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"