ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a cell based on a criteria (https://www.excelbanter.com/excel-programming/346490-selecting-cell-based-criteria.html)

pmundle

Selecting a cell based on a criteria
 
Hi,
I am new to Excel forms and VBA.I have created a form to fill data
to selected cells of a worksheet.I have two combo boxes from which the
user can select predefined values and some text boxes.The data needs to
be filled depending on these two combo box selections.

To illustrate this let us take a worksheet which has names of items nos
in cells A2:A10.Range B2:B13 contains the months Jan to Dec.The combo
box selects item no and month.The data is from text box is filled to
the respective cell depending on month and item no.
I have done the job by using select case procedure but this becomes
very long for a large worksheet and multiple criteria.Please help me
with some alternative method like search/find etc.
Thanks
P.Mundle


Bob Phillips[_6_]

Selecting a cell based on a criteria
 
I am not clear what you want to do with the data, but it seems that you
might need to know which item has been found.

If one combobox is pointing at A2:A10, the ListIndex will point at the index
within that range less 1, so if A2 is selected, it will be 0, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"pmundle" wrote in message
ups.com...
Hi,
I am new to Excel forms and VBA.I have created a form to fill data
to selected cells of a worksheet.I have two combo boxes from which the
user can select predefined values and some text boxes.The data needs to
be filled depending on these two combo box selections.

To illustrate this let us take a worksheet which has names of items nos
in cells A2:A10.Range B2:B13 contains the months Jan to Dec.The combo
box selects item no and month.The data is from text box is filled to
the respective cell depending on month and item no.
I have done the job by using select case procedure but this becomes
very long for a large worksheet and multiple criteria.Please help me
with some alternative method like search/find etc.
Thanks
P.Mundle




pmundle

Selecting a cell based on a criteria
 
I would like to fill data to the appropriate cell.
If A2:A10 contains item Nos 1 to 9,B1:B13 contains Jan to Dec, and I
want to enter data (say quantity purchased) for the month of April,item
No 7 ,my txtbox value should get copied to cell E8 only.E8 happens to
be the intersection of the Row containing "7" and the coloumn
containing "April".



Bob Phillips wrote:
I am not clear what you want to do with the data, but it seems that you
might need to know which item has been found.

If one combobox is pointing at A2:A10, the ListIndex will point at the index
within that range less 1, so if A2 is selected, it will be 0, etc.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"pmundle" wrote in message
ups.com...
Hi,
I am new to Excel forms and VBA.I have created a form to fill data
to selected cells of a worksheet.I have two combo boxes from which the
user can select predefined values and some text boxes.The data needs to
be filled depending on these two combo box selections.

To illustrate this let us take a worksheet which has names of items nos
in cells A2:A10.Range B2:B13 contains the months Jan to Dec.The combo
box selects item no and month.The data is from text box is filled to
the respective cell depending on month and item no.
I have done the job by using select case procedure but this becomes
very long for a large worksheet and multiple criteria.Please help me
with some alternative method like search/find etc.
Thanks
P.Mundle



pmundle

Selecting a cell based on a criteria
 
A correction for the previous post.B1:B13 is wrong.I mean,Row 1.
Cells B1,C1,D1, ....M1.for Jan to Dec.


Bob Phillips[_6_]

Selecting a cell based on a criteria
 
I thought that might be the case.

Are you PizzaFriend as well?

=OFFSET(A1,MATCH(Item,A2:A20,0),MATCH(Month,B1:M1, 0))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"pmundle" wrote in message
oups.com...
A correction for the previous post.B1:B13 is wrong.I mean,Row 1.
Cells B1,C1,D1, ....M1.for Jan to Dec.




pmundle

Selecting a cell based on a criteria
 
Thanks .It works.



All times are GMT +1. The time now is 03:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com