Need Code for copying/pasting irregular data from one workbook to another

Minerva7

New Member
Joined
Mar 24, 2019
Messages
15
DISCIPLINE 1
25-Mar
26-Mar
27-Mar
Team 1
205
197
195
Team 2
10
23
15
Team 3
267
290
293
Team 4
56
57
55
Team 5
2
0
4

<tbody>
</tbody>

Need code that will allow me to copy/paste daily total (extracted data) for each team into another Excel workbook with a table similar to the one above. I have 11 sheets, one per discipline, that contain anywhere from one up to fifteen teams each (all with different bug totals per day). This data can only be extracted by discipline, and comes out looking like this:

DISCIPLINE 1
25-Mar
Team 1
205
Team 2
10
Team 3
267
Team 4
56
Team 5
2

<tbody>
</tbody>

I have to do this 11 times, so it’s already tedious enough. Then, each discipline has up to multiple teams; so it’s a ton of copying pasting. Note: there are days when Team 5 of Discipline 1 has zero bugs, so the extracted data looks like this where Team 5 is omitted:

DISCIPLINE 1
26-Mar
Team 1
197
Team 2
23
Team 3
290
Team 4
57

<tbody>
</tbody>

Is there a way for me to paste values for only those teams that are included in the extracted data? Moreover, can Excel do a search by team name, then look for the next blank cell in the row for that team and paste (i.e. Team 1, 28-Mar, since 27-Mar has data)? I’m a serious VBA beginner, but I’m hoping someone can give me a jump start on this to save me some time while I learn VBA. This report is taking too much time to do, and it seems VBA is the only way to accomplish this? Whatever the case, I currently don't know how to get it done except manually.

I hope this makes sense. Thanks in advance for any amount of help you can offer.
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
To make the macro I have to see how your data is in book 1 (source) and in book 2 (destination)
So I need you to upload 2 files with examples, the data in book 1 should be in book 2 highlighted in yellow.

You could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,593
Office Version
  1. 2007
Platform
  1. Windows
I do not understand your book (origin). You only put one team, you must put at least 2 teams.
In the book (origin) you have "Team 2 - South Africa" ​​with 24, but in the book (destination), there is not that 24.
Nor does the date (origin) exist in the book, so where will I put the 24?

Upload another 2 books with clear examples.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,810
Messages
5,525,010
Members
409,615
Latest member
papaluigi94

This Week's Hot Topics

Top