View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Search a column to match textbox value from a form

Would you like to tell us a little bit about your user form? Like, are you
using labels, textboxes, list boxes or comboboxes to display the data that
you call from your worksheet. And how about the layout of the worksheet? Is
it designed so that the individual data elements that you intend to retrieve
can be easily accessed?
I have a program where I retrieve about ten data elements. I have them
arranged in columns so that all elements for a single call are on one row.
That allows me to not only locate them easily, but to also select them
individually for corrections. You can call them up by using the Find method,
in your case it would be by ID#. Then use Offset to access the individual
columns of data. To put the data in the form, if you use labels, Label1 =
ID#.Offset(0, 2). If you have five elements to populate you can use a loop
with a variable to get all five in one search.

For i = 1 To 5
Label & i = ID#.Offset(0, i)
Next

Maybe this will get you started.

"Albert" wrote:

Hi Guys,

I have designed a userform so that if a customer has called in before I need
to view certain fields of their previous interaction. I have a textbox
"Customer ID" which I would like to searchh through a worksheet find that ID
# then populate the corresponding previous information.

Any ideas.

Regards
Albert