Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Value From ComboBox On UserForm jlclyde Excel Discussion (Misc queries) 3 October 16th 09 01:43 PM
ComboBox on a UserForm LLoyd Excel Worksheet Functions 2 February 20th 08 09:01 PM
Userform w/ComboBox D.Parker Excel Discussion (Misc queries) 2 May 6th 05 04:28 PM
Combobox in userform Alvin Hansen[_2_] Excel Programming 6 August 9th 04 12:19 PM
ComboBox on UserForm Michel[_4_] Excel Programming 3 August 1st 04 11:10 PM


All times are GMT +1. The time now is 09:18 PM.

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

About Us

"It's about Microsoft Excel"