Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox and userform help!
Hey...
So I am having a lot of trouble writing a code for excel vba. I created a user form with a combo box, two textboxes, and a button. I figured out how to fill the combobox when the form loads already. I have a worksheet in excel with a column for descriptions and a column with the quanity corresponding to each item description. What I am trying to do, is when the user selects an option from the combobox(which is populated with the item description), and enters a quantity in the first textbox, I want excel to add that quantity to the corresponding quantity of the description already listed. I need it to add the quanity to the corresponding excel cell and to the second textbox on the form. I hope I explained what I am looking for clearly. THanks in advance for any help as I am seriously stuck! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox and userform help!
One post would normally be sufficient.
"dawn" wrote: Hey... So I am having a lot of trouble writing a code for excel vba. I created a user form with a combo box, two textboxes, and a button. I figured out how to fill the combobox when the form loads already. I have a worksheet in excel with a column for descriptions and a column with the quanity corresponding to each item description. What I am trying to do, is when the user selects an option from the combobox(which is populated with the item description), and enters a quantity in the first textbox, I want excel to add that quantity to the corresponding quantity of the description already listed. I need it to add the quanity to the corresponding excel cell and to the second textbox on the form. I hope I explained what I am looking for clearly. THanks in advance for any help as I am seriously stuck! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox and userform help!
Disregard the last message.
"dawn" wrote: Hey... So I am having a lot of trouble writing a code for excel vba. I created a user form with a combo box, two textboxes, and a button. I figured out how to fill the combobox when the form loads already. I have a worksheet in excel with a column for descriptions and a column with the quanity corresponding to each item description. What I am trying to do, is when the user selects an option from the combobox(which is populated with the item description), and enters a quantity in the first textbox, I want excel to add that quantity to the corresponding quantity of the description already listed. I need it to add the quanity to the corresponding excel cell and to the second textbox on the form. I hope I explained what I am looking for clearly. THanks in advance for any help as I am seriously stuck! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
combobox and userform help!
Assume you fill your combobox with data from Sheet1!A11:A110 Private Sub Combobox1_Click() Dim rng as Range, rng1 as Range Dim res as Variant With Worksheets("Sheet1") set rng = .Range("A11:A110") End With res = Appliction.Match(Combobox1.Value,rng,0) if not iserror(res) then set rng1 = rng(res).Offset(0,1) if isnumeric(Userform1.Textbox1.Value) then rng1.Value = rng1.Value & cDbl(Userform1.Textbox1.Value) Userform1.Textbox2.Value = rng1.Value end if End if End Sub -- Regards, Tom Ogilvy "dawn" wrote in message oups.com... Hey... So I am having a lot of trouble writing a code for excel vba. I created a user form with a combo box, two textboxes, and a button. I figured out how to fill the combobox when the form loads already. I have a worksheet in excel with a column for descriptions and a column with the quanity corresponding to each item description. What I am trying to do, is when the user selects an option from the combobox(which is populated with the item description), and enters a quantity in the first textbox, I want excel to add that quantity to the corresponding quantity of the description already listed. I need it to add the quanity to the corresponding excel cell and to the second textbox on the form. I hope I explained what I am looking for clearly. THanks in advance for any help as I am seriously stuck! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Value From ComboBox On UserForm | Excel Discussion (Misc queries) | |||
ComboBox on a UserForm | Excel Worksheet Functions | |||
Userform w/ComboBox | Excel Discussion (Misc queries) | |||
Combobox in userform | Excel Programming | |||
ComboBox on UserForm | Excel Programming |