Finding data,copying it and then pasting it into a new file

hero85

New Member
Joined
Mar 18, 2009
Messages
33
Hello,
I would like to create a macro to save time. I receive data which I then have to process in excel.
Right now, I need help with copying and pasting the data into new excel files automatically.
The data I receive is always like this:
--Start test--
45
34
23
454
232
--End Test--
--Start test--
99
33
22
--End Test--

So in this example, I received a file which had two tests in it that means two different files should be created. So I need to copy everything in between start test and end test. And then paste it into a new excel file.

So I want macro to find the words "Start Test",copy the data below it until "End Test" is reached. This data will then be paste into a new file. Then the macro should look for test 2 data by finding again the "Start Test" ,copy everything in between until "end test" is reached and then paste the data in a another new file.
Any links or any type of help will be appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Consider framing this question with some details that Excel people can grasp. Examples:

- Is what you posted really what the data looks like in terms of only occupying one column?
- If only one column, which column is it in?
- If more tha one column, which columns are they?
- What row does it start on?
- Is there an empty row in between the tests or as your post infers, there are no empty rows?
- How do you want the files named?
- What exactly do you want the files to look like:
- - - One sheet per file with one test in it?
- - - Just the test numbers or Start Test, numbers, and End Test all included?
 
Upvote 0
Thanks for your response Tom. The sheet will be similar to what I posted. The term Start Test will be in A1. The Range of Start Test will always vary.The second Start Test will always vary too.

If only one column, which column is it in?
There are actually two columns. I need to copy cell C and cell H.
What row does it start on?
Copy everything between Start and Stop.

-No blanks
-File name to save under? Users will save the file by themselves. I just want data to be copied into new workbooks.
Thanks.
 
Upvote 0

Forum statistics

Threads
1,203,026
Messages
6,053,114
Members
444,639
Latest member
xRockox

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