VBA Filter

F

Fleetzy

Right, im no novice, but im way short of being able to sort this littl
issue out on my jack jones.

Ive got a excel ss that has 80 lines of information and each line i
reportable to one of 20 different people, I need VBA to to pull togethe
all the lines that have the reportable name at the end of the line, e
EntriesErrorsEntriesHash TotalManager1000Jo Blogs
I need VBA to match all the names together and then dump into a ne
workbook, then save the file as the name in cell N2. the below is wha
ive come up with so far, but im lost on how i can get the VBA to selec
the new name from the filter list.

Sub copydata()
ActiveSheet.Range("$A$1:$N$419").AutoFilter Field:=14, Criteria1:=

"Jo Blogs"
Cells.Select
Range("B1").Activate
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("N2").Select
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
Selection.Copy
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "Jo Blogs"
ActiveWorkbook.SaveAs Filename:= _
"hidden"", _
ReadOnlyRecommended:=False, CreateBackup:=False
Cells.Select
Selection.ClearContents
Windows("Drubs.xls").Activate


End Su
 
D

Don Guillett

Right, im no novice, but im way short of being able to sort this little

issue out on my jack jones.



Ive got a excel ss that has 80 lines of information and each line is

reportable to one of 20 different people, I need VBA to to pull together

all the lines that have the reportable name at the end of the line, eg

EntriesErrorsEntriesHash TotalManager1000Jo Blogs

I need VBA to match all the names together and then dump into a new

workbook, then save the file as the name in cell N2. the below is what

ive come up with so far, but im lost on how i can get the VBA to select

the new name from the filter list.



Sub copydata()

ActiveSheet.Range("$A$1:$N$419").AutoFilter Field:=14, Criteria1:= _



"Jo Blogs"

Cells.Select

Range("B1").Activate

Selection.Copy

Workbooks.Add

ActiveSheet.Paste

Range("N2").Select

Application.CutCopyMode = False

Selection.Copy

Application.CutCopyMode = False

Selection.Copy

Application.CutCopyMode = False

ActiveCell.FormulaR1C1 = "Jo Blogs"

ActiveWorkbook.SaveAs Filename:= _

"hidden"", _

ReadOnlyRecommended:=False, CreateBackup:=False

Cells.Select

Selection.ClearContents

Windows("Drubs.xls").Activate





End Sub

Can't tell what you need without seeing. Send this msg, your file and complete expalanation to dguillett @gmail.com
 
M

Matthew Dyer

I had this same issue that I needed help with several years ago. Ron De Bruin helpe me immensely. He has a webpage article detailing how to do exactly this (using entries in a specific column, create new workbooks or worksheets based on unique values).

http://www.rondebruin.nl/copy5.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top