Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default 3 textbox values based on value in ComboBox1

I have a userform that contains TextBox1, TextBox2,
TextBox3, and ComboBox1.

I have a table of data on Sheet2 Range A2:C52. Now a
value will be entered in ComboBox1. I need a code that
will try to match the value in ComboBox1 with a value in
Range A2:C52 on Sheet2. If a match is NOT found, then do
nothing. If there IS a match with the value in ComboBox1,
then I need for the code to put the corresponding data in
the corresponding TextBoxes. The way it will do this is
as follows:

If the match is in a cell in Column A, then I need it to
put the data in that cell in Column A into TextBox1, and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column B, then I need it to
put the data in that cell in Column B into TextBox2 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column C, then I need it to
put the data in that cell in Column C into TextBox3 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

Its kind of hard to explain so I hope I hope everyone
understands. If more info is required, please let me know.


Thanx

Todd Huttenstine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 3 textbox values based on value in ComboBox1

Please don't keep posting the same post.

If this is the same userform as in your option button post, you have left
out any information on how it could be determined which column the combobox
is displaying. Also, you have not talked about your data - where is it
possible blanks would be found - are there blanks within the populated
cells - would there be a ID, name and no email, a name and email, but no id,
or are all blanks at the end of the column and if so, then why specify row
53 as the end.

The easiest way to do this would be to populate the combobox with all three
columns and get your data from there. Even if you only want to display one
set of data, you could control this with the columnwidth.
Alternately, you could make the combobox have two columns and place the row
number in the second column and hide that column.

Give it a whirl, then post your code if you have a question.

--
Regards,
Tom Ogilvy

Todd Huttenstine wrote in message
...
I have a userform that contains TextBox1, TextBox2,
TextBox3, and ComboBox1.

I have a table of data on Sheet2 Range A2:C52. Now a
value will be entered in ComboBox1. I need a code that
will try to match the value in ComboBox1 with a value in
Range A2:C52 on Sheet2. If a match is NOT found, then do
nothing. If there IS a match with the value in ComboBox1,
then I need for the code to put the corresponding data in
the corresponding TextBoxes. The way it will do this is
as follows:

If the match is in a cell in Column A, then I need it to
put the data in that cell in Column A into TextBox1, and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column B, then I need it to
put the data in that cell in Column B into TextBox2 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column C, then I need it to
put the data in that cell in Column C into TextBox3 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

Its kind of hard to explain so I hope I hope everyone
understands. If more info is required, please let me know.


Thanx

Todd Huttenstine



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default 3 textbox values based on value in ComboBox1

This post was not the same post. I added more details.
Is there more detail needed?


-----Original Message-----
Please don't keep posting the same post.

If this is the same userform as in your option button

post, you have left
out any information on how it could be determined which

column the combobox
is displaying. Also, you have not talked about your

data - where is it
possible blanks would be found - are there blanks within

the populated
cells - would there be a ID, name and no email, a name

and email, but no id,
or are all blanks at the end of the column and if so,

then why specify row
53 as the end.

The easiest way to do this would be to populate the

combobox with all three
columns and get your data from there. Even if you only

want to display one
set of data, you could control this with the columnwidth.
Alternately, you could make the combobox have two columns

and place the row
number in the second column and hide that column.

Give it a whirl, then post your code if you have a

question.

--
Regards,
Tom Ogilvy

Todd Huttenstine

wrote in message
...
I have a userform that contains TextBox1, TextBox2,
TextBox3, and ComboBox1.

I have a table of data on Sheet2 Range A2:C52. Now a
value will be entered in ComboBox1. I need a code that
will try to match the value in ComboBox1 with a value in
Range A2:C52 on Sheet2. If a match is NOT found, then

do
nothing. If there IS a match with the value in

ComboBox1,
then I need for the code to put the corresponding data

in
the corresponding TextBoxes. The way it will do this is
as follows:

If the match is in a cell in Column A, then I need it to
put the data in that cell in Column A into TextBox1, and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column B, then I need it to
put the data in that cell in Column B into TextBox2 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

If the match is in a cell in Column C, then I need it to
put the data in that cell in Column C into TextBox3 and
then the corresponding data in the other 2 cells in the
columns into the corresponding 2 Textboxes.

Its kind of hard to explain so I hope I hope everyone
understands. If more info is required, please let me

know.


Thanx

Todd Huttenstine



.

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
Calculate Textbox value based on another textbox value.doc Tdungate Excel Discussion (Misc queries) 1 February 12th 09 07:11 PM
Calculate Textbox value based on another textbox value Tdungate Excel Discussion (Misc queries) 0 February 12th 09 07:03 PM
a macro that Formats a textbox based on value in a cell txm49 Excel Worksheet Functions 1 June 6th 07 02:36 PM
ComboBox1 grahammal Excel Discussion (Misc queries) 1 March 20th 06 12:33 PM
How do I add TextBox.values? WTG Excel Worksheet Functions 1 February 27th 05 08:22 PM


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