Merging worksheets together

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to merge two worksheets together.

my first page has customer names,address,phone number, city, country.
The second page has each person's order they have made.

What i want to do is. On page one, if i double click John Doe, I want all of
the orders he has made to pop up. Instead of opening up two seperate forms
each time!.

I hope this makes sense
 
This is best implimented by adding a button to the toolbar to activate a
regular macro. Select a cells on sheet one and run macro. the macro
performs a copy of all rows that have the customer name in Column A. After
the macro is run all you have to do is do a paste where you want the rows the
data to be placed.

Sub findcustomer()

CustomerName = ActiveCell
First = True
With Sheets("Sheet2")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
For RowCount = 1 To LastRow

If .Range("A" & RowCount) = CustomerName Then
If First = True Then
Set SelectRows = .Rows(RowCount)
First = False
Else
Set SelectRows = _
Application.Union(SelectRows, _
.Rows(RowCount))
End If
End If
Next RowCount
End With

SelectRows.Copy

End Sub
 
Back
Top