First I will explain my problem.
I have directories named 2008,2009,2010,2011,2012 and 2013.
Within all directories are 2 large files (about 150mb to 220mb each) called Jumps and Flat. Each file has same number of columns with identical headings but varying number of rows
Each has 2 sheets (the data sheet and a blank sheet). Data sheet has same name as workbook.
I need to extract data based on values on one column only(always column m which is headed "Name").
In sheet 2 I have a named range (A1:A40) which I enter the values I need to search for. This can be any amount of different text values from 2-40. Each value can appear multiple times (or not at all) in the lookup workbooks or only appear in some workbooks. I need to extract the entire row where the lookup data appears in column M and paste into a new workbook. It will need to be done in order so 2008-2013.
Currently I open each book, enter the data in the named range area in sheet 2 and run a macro which filters the data sheet.
It is ok but time consuming to open each file as it takes a while due to the huge size and if I have all files open then it becomes hard to manage.
I need to
1 have a master sheet into which I enter the values to search for.
2 I choose whether to look in "Jumps" workbooks or "Flat" workbooks.
2 The macro then goes to each workbook (Flat or Jumps for each directory) and extracts all rows where the data appears and pastes this into a 2nd sheet in my master. this will already have the headers. I don't really want to have to open each file.
The macro I currently have is:
Dim v As Variant
Dim varCellContent As Range
Dim ws As String
On Error Resume Next
Set varCellContent = Application.InputBox(Prompt:="Choose a sheet by clicking on any cell in it.", Type:=8)
On Error GoTo 0
If Not varCellContent Is Nothing Then
ws = varCellContent.Parent.Name
Worksheets(ws).Activate
End If
If ActiveSheet.FilterMode Then
ActiveSheet.ShowAllData
End If
v = Application.Transpose(Range("MyList"))
Worksheets(ws).Range("$A$1:$HO$50000").AutoFilter Field:=13, Criteria1:=v, Operator:=xlFilterValues
End Sub
Many many thanks to any help you can give
I have Excel 2010
Bookmarks