Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Data Entry -Cell selection


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Data Entry -Cell selection

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
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
Force entry into cell, based on validation selection in adjacent cell Richhall[_2_] Excel Worksheet Functions 3 June 18th 09 10:28 AM
Data Entry Form : Cell selection P.Jaimal Excel Programming 0 November 26th 05 06:03 PM
data entry - cell selection P.Jaimal Excel Programming 0 November 26th 05 05:35 PM
How do you create a selection box for data entry within excel Ligia Magnus Excel Discussion (Misc queries) 1 May 25th 05 08:10 PM
Controlling cell selection during data entry BrianG[_3_] Excel Programming 0 September 17th 03 09:15 PM


All times are GMT +1. The time now is 10:49 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"