How to copy multiple ranges based on a specific value

Marco1234

New Member
Joined
Mar 2, 2020
Messages
8
Office Version
  1. 2010
Platform
  1. Windows
Hi,

I'm trying to achieve this but this is beyond my VBA skills.

I have a worksheets called "Results" on which in column "E" there is multiple sequence numbers (for example 12140, 12008, 12993...).

The sequence number will be repeated a variable number of times.

The data are already sorted. With a macro, I would like to be able to find all the matching sequence numbers and copy the sequence number (in column E) and the corresponding sample names in column A. The data would then be pasted on a different sheet (sheetname = sequence number, ex: 122140). I would then like to repeat this process for each different sequence number.

Here is a typical data set:

SampleValueUnitsfactorSequenceComment
6442-01
0.0010​
1​
12140​
test A
6442-02
1.0010​
1​
12140​
Test A
6442-03
2.0010​
1​
12140​
test B
6442-04
3.0010​
1​
12952​
test b
6442-05
4.0010​
1​
12952​
test b
6442-06
5.0010​
10​
12008​
test b
6442-07
6.0010​
1​
12008​
test b
6442-08
7.0210​
1​
12008​
test b
6442-09
8.0010​
1​
12008​
test b
6442-10
9.0010​
1​
12008​
test b
6442-11
10.0010​
1​
12008​
test b
6442-12
11.0010​
1​
12008​
test b
6442-13
11.0010​
1​
12008​
test b
6442-14
13.0010​
1​
12008​
test b
6442-15
14.0010​
10​
12008​
test b
6442-16
15.0010​
1​
12993​
test b

Thanks for your help!!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,

I'm trying to achieve this but this is beyond my VBA skills.

I have a worksheets called "Results" on which in column "E" there is multiple sequence numbers (for example 12140, 12008, 12993...).

The sequence number will be repeated a variable number of times.

The data are already sorted. With a macro, I would like to be able to find all the matching sequence numbers and copy the sequence number (in column E) and the corresponding sample names in column A. The data would then be pasted on a different sheet (sheetname = sequence number, ex: 122140). I would then like to repeat this process for each different sequence number.

Here is a typical data set:

SampleValueUnitsfactorSequenceComment
6442-01
0.0010​
1​
12140​
test A
6442-02
1.0010​
1​
12140​
Test A
6442-03
2.0010​
1​
12140​
test B
6442-04
3.0010​
1​
12952​
test b
6442-05
4.0010​
1​
12952​
test b
6442-06
5.0010​
10​
12008​
test b
6442-07
6.0010​
1​
12008​
test b
6442-08
7.0210​
1​
12008​
test b
6442-09
8.0010​
1​
12008​
test b
6442-10
9.0010​
1​
12008​
test b
6442-11
10.0010​
1​
12008​
test b
6442-12
11.0010​
1​
12008​
test b
6442-13
11.0010​
1​
12008​
test b
6442-14
13.0010​
1​
12008​
test b
6442-15
14.0010​
10​
12008​
test b
6442-16
15.0010​
1​
12993​
test b

Thanks for your help!!
Can you provide a sample desired output tab?
 
Upvote 0

Forum statistics

Threads
1,215,136
Messages
6,123,251
Members
449,093
Latest member
Vincent Khandagale

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