Loop through data and build an array

2077delta

Active Member
Joined
Feb 17, 2002
Messages
250
Office Version
  1. 365
Platform
  1. Windows
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.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Its a safe bet that we will need more information and likely an example of the data, particularly its layout.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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