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.

Spool #
Activity
NDE
Size
Type
Sched.
WPS
Welder
Inspector
Weld/Insp. Date
P/F
VT
PT/MT
4
Weld
RT
14"
BUTTWELD
STD
140
JO
Bhanson
11/20/18
Pass
100%
5%
4
Weld
VT
14"
BUTTWELD
STD
140
JO
Bhanson
11/20/18
Pass
100%
5%
4
Weld
RT
12"
BUTTWELD
STD
140
JO
Bhanson
11/20/18
Pass
100%
5%
4
Weld
VT
12"
BUTTWELD
STD
140
JO
Bhanson
11/20/18
Pass
100%
5%
8
Weld
Brinnell
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
RT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
VT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
Brinnell
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
RT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
VT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
Brinnell
4"
BUTTWELD
STD
116V
A5
Bhanson
12/04/18
Pass
100%
5%
8
Weld
RT
4"
BUTTWELD
STD
116V
A5
Bhanson
12/04/18
Pass
100%
5%
8
Weld
VT
4"
BUTTWELD
STD
116V
A5
Bhanson
12/04/18
Pass
100%
5%
8
Weld
Brinnell
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
RT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%
8
Weld
VT
4"
BUTTWELD
STD
116V
WL
Bhanson
12/04/18
Pass
100%
5%

<tbody>
</tbody>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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,215,337
Messages
6,124,340
Members
449,155
Latest member
ravioli44

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