Extracting a different amount of rows from large amounts of data

larzukmoose

New Member
Joined
Apr 16, 2015
Messages
5
Hello!

I could use some help extracting data from one sheet and moving it to another where it will be easier for me to analyze. The data is text information that is all in one column and looks something similar to this:

Start Word
Data
Data
Data
End Word
Nonsense
Nonsense
Nonsense
Start Word
Data
Data
End Word
Nonsense

I would like to be able to have a macro that I could run that would, on a new sheet, give me an output that would look like:

Start Word
Data
Data
Data

Start Word
Data
Data

And so on, going through the entire column and clearing out all of the nonsense and end words that I don't need to look at. I had a macro that I found on a different site that was able to find the start word and copy any number of rows down and move them to a different sheet. The issue is that I had set that number of rows to 5 or something, and sometimes the data is longer than 5 rows and sometimes it is less. Is there a way to set it to stop once it reaches an end word?

Thanks so much in advance for any help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This might not be what you're looking for, but as nobody else how responded yet, it might be better than nowt.

Excel 2012
AB
2Start WordStart Word
3DataData
4DataData
5DataData
6End Word0
7Nonsense0
8Nonsense0
9Nonsense0
10Start WordStart Word
11DataData
12DataData
13End Word0
14Nonsense0

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=IF(A2="Start Word",A2,IF(OR(A2="End Word",ISNUMBER(B1)),0,A2))
B3=IF(A3="Start Word",A3,IF(OR(A3="End Word",ISNUMBER(B2)),0,A3))
B4=IF(A4="Start Word",A4,IF(OR(A4="End Word",ISNUMBER(B3)),0,A4))
B5=IF(A5="Start Word",A5,IF(OR(A5="End Word",ISNUMBER(B4)),0,A5))
B6=IF(A6="Start Word",A6,IF(OR(A6="End Word",ISNUMBER(B5)),0,A6))
B7=IF(A7="Start Word",A7,IF(OR(A7="End Word",ISNUMBER(B6)),0,A7))
B8=IF(A8="Start Word",A8,IF(OR(A8="End Word",ISNUMBER(B7)),0,A8))
B9=IF(A9="Start Word",A9,IF(OR(A9="End Word",ISNUMBER(B8)),0,A9))
B10=IF(A10="Start Word",A10,IF(OR(A10="End Word",ISNUMBER(B9)),0,A10))
B11=IF(A11="Start Word",A11,IF(OR(A11="End Word",ISNUMBER(B10)),0,A11))
B12=IF(A12="Start Word",A12,IF(OR(A12="End Word",ISNUMBER(B11)),0,A12))
B13=IF(A13="Start Word",A13,IF(OR(A13="End Word",ISNUMBER(B12)),0,A13))
B14=IF(A14="Start Word",A14,IF(OR(A14="End Word",ISNUMBER(B13)),0,A14))

<tbody>
</tbody>

<tbody>
</tbody>

Then all you need to do is filter out the 0's and paste where you wish it.

Q
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,309
Members
449,080
Latest member
jmsotelo

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