How do I extract data given a criteria from a data set into another tab?

Robotrix

New Member
Joined
Jul 6, 2014
Messages
23
I hope I can clearly explain my question here. I am seeking to extract only specific entries from a data collection of approximately 1500 rows given a specific criteria (Cell H3). I've provided a screen shot of what I"m looking at with some Mock data to help the process. To summarize: I want to be able to automatically pull Project#, section, tech, MOB, & KM within all rows from "Data Dump Sheet" that begin with "CM-GF-20", and have them appear in "Past Runs Sheet". The code "CM-GF-20" is dependent on cell H3 from "Past Runs Sheet". I'm pretty sure it involves a sub-array formula of some sorts, but I don't seem to be able to get it to work, any and all help is appreciated!



Past Runs Sheet

*ABCDEFGHIJK
1*Line Specifications**Trap Sections**Corresponding Line Code***
2***********
3*Line Number:**Launch:Cromer*CM-GF-20
***
4*Diameter:20*Receive:Gretna*****
5***********
6***********
7Past Line Runs**********
8***********
9Line CodeProject #SectionTechMOBKM*****
10***********
11***********
12***********
13***********
14***********

<tbody>
</tbody>


Data Dump Sheet

*ABCDEF
7******
8******
9Line CodeProject #SectionTechMOBKM
10CM-GF-2010121120BISN19283
11WS-NN-1210363912ACD132.91
12WNR-EB-1210363912CCLP201.06
13KB-QU-2010363920BCLP18352.63
14NN-WNR-2010363920FCLP2072.84
15YP-KB-2410363924ACLP19175.85
16YP-KB-2410363924AICR22175.85
17YP-KB-2410363924ASDY21175.85
18CM-GF-1610629216CCLP43282.7
19CM-GF-1610629216CISN77282.7
20KB-QU-2010629220DSDY72352.63
21EP-YP-2410629224ACLP55175.45
22EP-YP-2410629224BCDX69175.45
23EP-YP-2410629224BICR73175.45
24EP-YP-2410629224BSDY70175.45
25KB-QU-2410629224CICR74352.91
26KB-QU-2410629224CSDY71352.91
27EP-YP-2410629224FCDX75175.45
28KB-QU-2410629224GCDX76352.91
29QU-CM-3410629234CCDX57254.64
30YP-KB-3410629234EWMX60175.6
31NW-RE-3010764630AMF317194
32ML-CD-3010764630BCLP18206.04
33VG-PL-3610764936AM3X646.56
34CR-CS-3610764936CM3X771

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Would you consider a macro approach? If so, try this in a copy of your workbook.
Rich (BB code):
Sub GetData()
  Application.ScreenUpdating = False
  Sheets("Past Runs Sheet").Range("A9").CurrentRegion.Offset(1).Resize(, 6).ClearContents
  With Sheets("Data Dump Sheet").Range("A9").CurrentRegion.Resize(, 6)
    .AutoFilter Field:=1, Criteria1:=Sheets("Past Runs Sheet").Range("H3").Value
    .Offset(1).Copy Destination:=Sheets("Past Runs Sheet").Range("A10")
    .AutoFilter
  End With
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Would you consider a macro approach? If so, try this in a copy of your workbook.
Rich (BB code):
Sub GetData()
  Application.ScreenUpdating = False
  Sheets("Past Runs Sheet").Range("A9").CurrentRegion.Offset(1).Resize(, 6).ClearContents
  With Sheets("Data Dump Sheet").Range("A9").CurrentRegion.Resize(, 6)
    .AutoFilter Field:=1, Criteria1:=Sheets("Past Runs Sheet").Range("H3").Value
    .Offset(1).Copy Destination:=Sheets("Past Runs Sheet").Range("A10")
    .AutoFilter
  End With
  Application.ScreenUpdating = True
End Sub
I would be entirely open to a macro approach. I tried this one in a copy of my workbook and it simply created a blue line in row 10, nothing else was changed, I ensured that all tab names were correct, etc.
 
Upvote 0
... it simply created a blue line in row 10, nothing else was changed,....
I had assumed from your screen shots that row 8 on each sheet was blank. Perhaps that is not the case or there is further data to the right of what you have shown that caused my code to do that. In any case, try this version.
Rich (BB code):
Sub GetData_v2()
  Dim wsDD As Worksheet, wsPR As Worksheet
  
  Set wsDD = Sheets("Data Dump Sheet")
  Set wsPR = Sheets("Past Runs Sheet")
  
  Application.ScreenUpdating = False
  With wsPR
    .Range("A9", .Range("A" & .Rows.Count).End(xlUp)).Offset(1).Resize(, 6).ClearContents
  End With
  With wsDD.Range("A9", wsDD.Range("A" & wsDD.Rows.Count).End(xlUp)).Resize(, 6)
      .AutoFilter Field:=1, Criteria1:=wsPR.Range("H3").Value
      .Offset(1).Copy Destination:=wsPR.Range("A10")
      .AutoFilter
  End With
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thank-you both for your help. I managed to get the array formula to work, as well as the macro! I really do appreciate you taking the time to help out an excel dummy!
 
Upvote 0
Upvote 0
Just confirming that you are not interested in a macro approach this time?
If you are, is the "specific Tech" stored on one of the sheets somewhere? (Where?)
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,668
Members
449,463
Latest member
Jojomen56

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