View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Albert Albert is offline
external usenet poster
 
Posts: 203
Default Search a column to match textbox value from a form

Thanks works perfectly.

Would you know how 4 users, using the same worksheet format and form, can
get their worksheet automatically updated to a closed spreadsheet and also
access data from the master if it is closed?

"Bernie Deitrick" wrote:

Albert,

Put a commandbutton on your userform, with code like

Private Sub CommandButton1_Click()
Dim myC As Range
Set myC = Worksheets("Sheet1").Range("A:A").Find(UserForm1.T extBox1.Text)
If myC Is Nothing Then
Msgbox UserForm1.TextBox1.Text & " was not found."
Else
Userform1.TextBox2.Text = myC(1,2).Value 'Pick up the cell to the right of the ID#
Userform1.TextBox3.Text = myC(1,3).Value 'Pick up the cell two to the right of the ID#
End If
End Sub

You cannot have a textbox named "Customer ID" since that is an illegal name....

HTH,
Bernie
MS Excel MVP


"Albert" wrote in message
...
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