Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Selecting a cell based on a criteria

Thanks .It works.

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
Selecting rows based on criteria JCP Excel Discussion (Misc queries) 3 April 5th 06 09:26 AM
Selecting rows based simultaneously on 3 criteria miserere Excel Programming 4 September 21st 05 07:33 PM
VBA - Selecting Based on Criteria ajocius[_21_] Excel Programming 2 August 7th 05 08:22 AM
Selecting Sheets based on Cell Criteria. Tim Richards Excel Programming 3 May 25th 05 12:28 AM
selecting and deleting a row based on a cell value JJ Excel Programming 4 December 1st 04 05:59 PM


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

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"