Matching data in column of existing worksheet and creating another worksheet based on search result

PMCCAULEY

New Member
Joined
Dec 5, 2018
Messages
3
I am working on extracting some information from an existing spreadsheet and copying the information to another sheet based on search. In column named Welder I want to extract that rows information for each individual welder initial and create a different workbook for each one. What would be the simplest way to achieve this? I am thinking Macro but don't know where to start. This is worksheet 1 from which the information will pull from.

[TABLE="width: 734"]
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"]Spool #
[/TD]
[TD="width: 64, bgcolor: transparent"]Activity
[/TD]
[TD="width: 64, bgcolor: transparent"]NDE
[/TD]
[TD="width: 64, bgcolor: transparent"]Size
[/TD]
[TD="width: 140, bgcolor: transparent"]Type
[/TD]
[TD="width: 64, bgcolor: transparent"]Sched.
[/TD]
[TD="width: 64, bgcolor: transparent"]WPS
[/TD]
[TD="width: 89, bgcolor: transparent"]Welder
[/TD]
[TD="width: 64, bgcolor: transparent"]Inspector
[/TD]
[TD="width: 109, bgcolor: transparent"]Weld/Insp. Date
[/TD]
[TD="width: 64, bgcolor: transparent"]P/F
[/TD]
[TD="width: 64, bgcolor: transparent"]VT
[/TD]
[TD="width: 64, bgcolor: transparent"]PT/MT
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]14"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]140
[/TD]
[TD="bgcolor: transparent"]JO
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]11/20/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]14"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]140
[/TD]
[TD="bgcolor: transparent"]JO
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]11/20/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]12"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]140
[/TD]
[TD="bgcolor: transparent"]JO
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]11/20/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]4
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]12"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]140
[/TD]
[TD="bgcolor: transparent"]JO
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]11/20/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]Brinnell
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]Brinnell
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]Brinnell
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]A5
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]A5
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]A5
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]Brinnell
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]RT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]8
[/TD]
[TD="bgcolor: transparent"]Weld
[/TD]
[TD="bgcolor: transparent"]VT
[/TD]
[TD="bgcolor: transparent"]4"
[/TD]
[TD="bgcolor: transparent"]BUTTWELD
[/TD]
[TD="bgcolor: transparent"]STD
[/TD]
[TD="bgcolor: transparent"]116V
[/TD]
[TD="bgcolor: transparent"]WL
[/TD]
[TD="bgcolor: transparent"]Bhanson
[/TD]
[TD="bgcolor: transparent"]12/04/18
[/TD]
[TD="bgcolor: transparent"]Pass
[/TD]
[TD="bgcolor: transparent"]100%
[/TD]
[TD="bgcolor: transparent"]5%
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi & welcome to MrExcel.
How about
Code:
Sub FilterCopy()
   Dim Ws As Worksheet
   Dim Cl As Range
   
   Set Ws = Sheets("Sheet1")
   If Ws.AutoFilterMode Then Ws.AutoFilterMode = False
   With CreateObject("scripting.dictionary")
      For Each Cl In Ws.Range("H2", Ws.Range("H" & Rows.Count).End(xlUp))
         If Not .Exists(Cl.Value) Then
            .Add Cl.Value, Nothing
            Ws.Range("A1:M11").AutoFilter 8, Cl.Value
            Sheets.Add(, Ws).Name = Cl.Value
            Ws.AutoFilter.Range.Copy Sheets(Cl.Value).Range("A1")
         End If
      Next Cl
   End With
   Ws.AutoFilterMode = False
End Sub
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub FilterCopy()
   Dim Ws As Worksheet
   Dim Cl As Range
   
   Set Ws = Sheets("Sheet1")
   If Ws.AutoFilterMode Then Ws.AutoFilterMode = False
   With CreateObject("scripting.dictionary")
      For Each Cl In Ws.Range("H2", Ws.Range("H" & Rows.Count).End(xlUp))
         If Not .Exists(Cl.Value) Then
            .Add Cl.Value, Nothing
            Ws.Range("A1:M11").AutoFilter 8, Cl.Value
            Sheets.Add(, Ws).Name = Cl.Value
            Ws.AutoFilter.Range.Copy Sheets(Cl.Value).Range("A1")
         End If
      Next Cl
   End With
   Ws.AutoFilterMode = False
End Sub

When I run the Macro it just deletes all the information from column and creates a sheet 2
 
Upvote 0
Re-Ran it again and now it deletes all information from sheet1 except column headings and creates separate sheets with the person initials but only returns the column headings and none of the information in the rows.
 
Upvote 0
That code does not delete anything.
It should simply create new sheets, name them as per the value in col H and then copy columns A:M to the new sheet.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top