Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi , My knowledge about excel programming is very limited. I have a sheet with months in the first row. The first column contains names of Products. The intervening grid contains the sales of these items for these months. A B C D E 1 APR MAY JUNE JULY 2 PRODUCT 1 3 PRODUCT 2 4 PRODUCT 3 5 PRODUCT 4 My userform has comboboxes "cboMonth" and "cboProduct".A text box "txtSales".I would like to enter data into the sheet depending on the selections of the two comboboxes.Example: if cboMonth.Value="MAY" AND cboProduct.Value ="PRODUCT 3" then the data from txtSales should get copied to the cell "C4". I am unable to link these using code.My sheet is very long with many products(and therefore many Rows).Hence a data entry form is very much useful . Please help. P.Jaimal |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If we can assume the products and the months are in the same order on the
sheet as in the comboboxes then all you'd have to do is to use the comboboxes' ListIndex properties to determine the offset of the target cell from the top left of the table. Something like: Range("A1").Offset(ComboBox1.ListIndex + 1,ComboBox2.ListIndex + 1).Value = txtSales.Value The "+ 1" is because the ListIndex property starts at 0. You'd have to fine-tune this example in any case. If the opening assumption isn't correct then you'd have to add intermediate steps to fine the row and column offsets using the Application.Match function. Sort of like: RowOffset = Application.Match(ComboBox1.Value, Range("A:A"), False) -- Jim "P.Jaimal" wrote in message oups.com... Hi , My knowledge about excel programming is very limited. I have a sheet with months in the first row. The first column contains names of Products. The intervening grid contains the sales of these items for these months. A B C D E 1 APR MAY JUNE JULY 2 PRODUCT 1 3 PRODUCT 2 4 PRODUCT 3 5 PRODUCT 4 My userform has comboboxes "cboMonth" and "cboProduct".A text box "txtSales".I would like to enter data into the sheet depending on the selections of the two comboboxes.Example: if cboMonth.Value="MAY" AND cboProduct.Value ="PRODUCT 3" then the data from txtSales should get copied to the cell "C4". I am unable to link these using code.My sheet is very long with many products(and therefore many Rows).Hence a data entry form is very much useful . Please help. P.Jaimal |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Force entry into cell, based on validation selection in adjacent cell | Excel Worksheet Functions | |||
Data Entry Form : Cell selection | Excel Programming | |||
data entry - cell selection | Excel Programming | |||
How do you create a selection box for data entry within excel | Excel Discussion (Misc queries) | |||
Controlling cell selection during data entry | Excel Programming |