Loop through data and build an array

2077delta

Board Regular
Joined
Feb 17, 2002
Messages
241
I have a sheet of data, not in table form, more like a report with blocks of data that repeat themselves as you go down the page. I want to go through the data and extract some of the data and copy it to a different worksheet. I was thinking of using the Find function to locate where each block of data starts (Find "Employee No."). I would then want to get the data offset 0 rows and 2 columns (Employee Name) and offset 5 rows and 4 columns, 5 rows and 5 columns, 5 rows and 6 columns, 5 rows and 7 columns and 6 rows and 7 columns (the payroll data), to build a table that looks like this:

Joe Greene 3251.23 721.43 218.57 25.12 2286.11
Deacon Jones 3516.67 801.33 266.82 31.48 2417.04
So on and so forth

I understand the best way to do this is to build an array then paste it into my spreadsheet. Obviously, I'm not really sure how I do that. Any help would be greatly appreciated as I have several other tasks I could apply this same routine to.
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Steve_

Board Regular
Joined
Apr 28, 2010
Messages
167
Its a safe bet that we will need more information and likely an example of the data, particularly its layout.
 

2077delta

Board Regular
Joined
Feb 17, 2002
Messages
241
Gladly, but, pardon my lack of knowledge, I don't seem to be able to paste in a screen shot and I don't know how to attach the file or somehow transfer the data on the worksheet into this thread.
 

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
2077delta,

We can not tell what worksheet(s), cells, rows, columns, your raw data is in.

And, we can not tell what the results should look like.

Can you post a screen shot of what your data looks like?

Section B at this link has instructions on how to post a screen shot: https://www.mrexcel.com/forum/board-...forum-use.html

You cannot upload files to the site, however there are add-ins available here https://www.mrexcel.com/forum/about-...tachments.html that enable you to include sample data in the post

Alternately, 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.

Include a detailed explanation of what you would like to do referring to specific cells, rows, columns and worksheets.

If the workbook contains confidential information, you could replace it with generic data.
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,041
Office Version
2010
Platform
Windows
Okay, two things...

1) Can you post another sheet showing what you want outputted from that same data you just posted?

2) Your posted sheet shows rows with values like "1 of 37", "2 of 37", "3 of 37", and so on all in rows by themselves. Are those values physically on your data worksheet or are they some kind of page markers that are not really mixed into your actual data?
 

hiker95

Well-known Member
Joined
Apr 8, 2009
Messages
17,649
2077delta,

Your link to your workbook is not working?

We would like to see what your raw data workbook/worksheets look like, and, we would like to see what the resulting worksheet, manually formatted by you, should look like.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,439
Messages
5,486,900
Members
407,570
Latest member
cannotquitexcel

This Week's Hot Topics

Top