Copy rows from multiple different ranges within one sheet to another sheet with and/or without VBA

hairlossbyexcel

New Member
Joined
May 16, 2014
Messages
7
Hello,

The last few days I have been trying to figure this out with no luck whatsoever. I am using Excel 2010 32-bit with power query on a Windows 7 64-bit computer. I was going the use the html creator, but the dl link was down and I had to use screenshots.

I have a sheet titled "LeadSheet" that contains multiple data blocks of information (around 20). I have attached 2 examples of these data blocks and 2 examples of results needed below. I tried to create them so they would fill in the gaps of my explanation.

All of these data blocks are 7 columns wide and vary in row size from 10-250. The blocks of data all have titles on the 5th row, but are not headers, and then data beginning directly underneath. I hesitate calling them ranges because I only selected one data block as a range and named it "lead1" and then stopped not knowing if I was headed the right direction.

I first tried to create a table out of the range, but was unable to do so because the "Name" column is an array.
The phone and address columns are populated by VLOOKUP. And although the images show the column names as the same for name, phone and address theyare actually different, like name-firm1, name-firm17,address-firmxyz, etc, etc.
I apologize for not putting that in the images.
The "Option 1", "Option 2", "Option 3" and "Option 4" columns are generated using a =IF formula.

I have another sheet titled "ResultsSheet".I'm needing a way or code to copy entire rows from the multiple data blocks/ranges in the "LeadSheet", and paste it in the"ResultsSheet", based on any value occurring in any of the"Option" columns within the individual data blocks/ranges along with appending the "Option #" title to either end of the copied row.

The "LeadSheet" is constantly being updated so information is being added and taken off all the time. That being said, is there anyway to make it update as soon as the "LeadSheet" does or on a timed interval so that the"ResultsSheet" is always up to date. And also prevent it from continuing to re-copy over duplicates of information that has not changed?

Ifthe "Option #" result is the exact same percentage then the order does not matter between them.

Ifwithin the same data block/range both "Option" columns have data it is usually because of some error and is most likely bad datathat does not need to be copied. i.e. "Steven Seagal". If that makes this task much more difficult I can live with it.

If within two or more different data blocks/ranges the same name and info appears that if fine because the "Option #" will always be different. i.e. "Chuck Norris".

I am also trying to make the "ResultSheet" ordered from largest percentage to lowest, but I assume that should be done once the data is on the "ResultsSheet". No headers or titles are necessary on the "ResultsSheet"

I apologize for being so long winded in my attempt to be clear. If I need to clarify anything more please do not hesitate to ask.
Any and all help is greatly appreciated. Thank you.

Data Block example 1:

excel1.png


Data Block example 2:
excel2.png



Results:
excel3.png

either/or
excel4.png
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
hairlossbyexcel,

Is this even feasible?

We would have to see your actual raw data.

You are posting pictures/graphics. This means that if this was a problem where one needed to use your data, anyone trying to help you would have to enter the data manually. That makes no sense.


1. What version of Excel and Windows are you using?

2. Are you using a PC or a Mac?

Can you post a screenshot of the actual raw data worksheet?

And, can you post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
http://www.mrexcel.com/forum/board-announcements/515787-forum-posting-guidelines.html#post2545970

Or, when using Internet Explorer, just put borders around your data in Excel and copy those cells into your post.
See reply #2 the BLUE text in the following link:
http://www.mrexcel.com/forum/about-board/444901-how-create-table-like-aladin.html#post2198045


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.
 
Upvote 0
hairlossbyexcel,



We would have to see your actual raw data.

You are posting pictures/graphics. This means that if this was a problem where one needed to use your data, anyone trying to help you would have to enter the data manually. That makes no sense.

I do apologize. In my haste to get something posted without a working link to a htmlmaker of some kind, I just posted screenshots. Thank you for a working link to a html maker.

What version of Excel and Windows are you using?

Please refer to the second sentence of the OP.


Are you using a PC or a Mac?

Please refer to the second sentence of the OP.

Can you post a screenshot of the actual raw data worksheet?

I am unable to do that, but I did post a screenshot of generic data I created that represented the actual raw data that I need help with.
I will however post them as html this time so they can be cut and paste.

And, can you post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

Same as the previous answer. I will also add that I am open to whatever makes it easier for the results worksheet whether that be with/without headings, table, or nothing but the raw results.

To post your data, you can download and install one of the following two programs:
Excel Jeanie
http://www.mrexcel.com/forum/board-announcements/515787-forum-posting-guidelines.html#post2545970

Or, when using Internet Explorer, just put borders around your data in Excel and copy those cells into your post.
See reply #2 the BLUE text in the following link:
http://www.mrexcel.com/forum/about-board/444901-how-create-table-like-aladin.html#post2198045

Again, thank you for the link.


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.

If it becomes necessary for a workbook to be uploaded I will create one with the information I have provided here and upload it.


I tried to edit my op to reflect this, but was unable to do so:

-I have made all data blocks now named ranges "lead1", "lead2", etc.

-Ifwithin the same data block/range both "Option" columns have data it is usually because of some error and is most likely bad datathat does not need to be copied. i.e. "Steven Seagal". If that makes this task much more difficult I can live with it.* Edit - I have backtracked on this decision and believe it best to include this information if possible. The examples below will reflect that.


worksheet "LeadSheet"; range "lead1"

Excel 2010
JKLMNOP
5Name-CHomePh-564MobilePh-ghrAddress-fggrbStateZip-adsgOption 1Option 2
6Prof Plum555-555-1234123-345-3677123 Random RdAL 354011.23%
7Col Mustard555-555-2345123-345-63444567 Random RdAK 99999
8Ms Scarlet555-555-3456123-345-32435476 Random RdNY 1234587.57%
9Mrs. Peacock555-555-4567123-345-3254677 Random RdNE 5874210.00%
10Mr. Green555-555-5678123-345-0976769 Random RdWA 85472
11Ms. White555-555-6789123-345-2133568 Random RdOR 5124717.00%
12Chuck Norris555-555-4567123-345-77779083 Random RdMT 2159865.00%

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
LeadSheet



worksheet "LeadSheet"; range "lead2"

Excel 2010
TUVWXYZ
5Name-YHomePh-997MobilePh-342Address-yuiStateZip-xzcOption 3Option 4
6Macgyver555-555-1111123-345-99993301 Silent PathwayIA, 51558
7Sinjin555-555-2222123-345-88883854 Cinder AbbeyOK, 7333625.20%
8Scrooge555-555-3333123-345-7777233 Dewy PromenadeMO, 6420890.50%
9Chuck Norris555-555-4444123-345-34347204 Thunder VillageOH, 43823100.00%
10Bruce Lee555-555-5555123-345-27273780 Fallen Sky FieldMO, 63457100.00%
11Steven Seagal555-555-6666123-345-76766131 Merry RoundOH, 443092.77%77.00%

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
LeadSheet



worksheet "ResultsSheet"

Excel 2010
ABCDEFG
1NameHomePhMobilePhAddressStateZipPercentageOption #
2Bruce Lee555-555-5555123-345-27273780 Fallen Sky FieldMO, 63457100.00%Option 3
3Chuck Norris555-555-4444123-345-34347204 Thunder VillageOH, 43823100.00%Option 4
4Scrooge555-555-3333123-345-7777233 Dewy PromenadeMO, 6420890.50%Option 3
5Ms Scarlet555-555-3456123-345-32435476 Random RdNY 1234587.57%Option 1
6Steven Seagal555-555-6666123-345-76766131 Merry RoundOH, 4430977.00%Option 4
7Chuck Norris555-555-4567123-345-77779083 Random RdMT 2159865.00%Option 2
8Sinjin555-555-2222123-345-88883854 Cinder AbbeyOK, 7333625.20%Option 4
9Ms. White555-555-6789123-345-2133568 Random RdOR 5124717.00%Option 1
10Mrs. Peacock555-555-4567123-345-3254677 Random RdNE 5874210.00%Option 2
11Steven Seagal555-555-6666123-345-76766131 Merry RoundOH, 443092.77%Option 3
12Prof Plum555-555-1234123-345-3677123 Random RdAL 354011.23%Option 1

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
ResultsSheet



worksheet "ResultsSheet" (If it is to difficult to combine the percentage columns like the example above)

Excel 2010
ABCDEFGH
1NameHomePhMobilePhAddressStateZipPercentagePercentage2Option #
2Bruce Lee555-555-5555123-345-27273780 Fallen Sky FieldMO, 63457100.00%Option 3
3Chuck Norris555-555-4444123-345-34347204 Thunder VillageOH, 43823100.00%Option 4
4Scrooge555-555-3333123-345-7777233 Dewy PromenadeMO, 6420890.50%Option 3
5Ms Scarlet555-555-3456123-345-32435476 Random RdNY 1234587.57%Option 1
6Steven Seagal555-555-6666123-345-76766131 Merry RoundOH, 443092.77%77.00%Option 4
7Chuck Norris555-555-4567123-345-77779083 Random RdMT 2159865.00%Option 2
8Sinjin555-555-2222123-345-88883854 Cinder AbbeyOK, 7333625.20%Option 4
9Ms. White555-555-6789123-345-2133568 Random RdOR 5124717.00%Option 1
10Mrs. Peacock555-555-4567123-345-3254677 Random RdNE 5874210.00%Option 2
11Steven Seagal555-555-6666123-345-76766131 Merry RoundOH, 443092.77%77.00%Option 3
12Prof Plum555-555-1234123-345-3677123 Random RdAL 354011.23%Option 1

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
ResultsSheet



Would this be better accomplished with a formula or vba? I prefer formulas...most likely out of ignorance of vba.
 
Upvote 0
hairlossbyexcel,

Thanks for the screenshots.

I have another sheet titled "ResultsSheet".I'm needing a way or code to copy entire rows from the multiple data blocks/ranges in the "LeadSheet", and paste it in the"ResultsSheet", based on any value occurring in any of the"Option" columns within the individual data blocks/ranges along with appending the "Option #" title to either end of the copied row.

If I understand you correctly, based on your instructions/directions, I would think that a formula solution would not work for the ResultsSheet

You will have to pick/choose what the ResultsSheet should look like?


At the present time, I can not see the logic to solve your request.

Click on the Reply to Thread button, and just put the word BUMP in the thread. Then, click on the Post Quick Reply button, and someone else will assist you.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

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