Looping through range and transferring data to column - please help!

joeyexcelrookie

New Member
Joined
Jan 27, 2014
Messages
1
Hi everyone,

I've got a range of data in sheet1 that I want to sort through and transfer to single column in sheet2. This should hopefully be quite a simple task.

The data is in sheet1 in the range E12:M100. I want to some code that goes through each row (like reading a book) and transfers all the non-zero items into a new column in sheet2. Hopefully this process can be done with a trigger key that automatically creates the new sheet and places the column in a specified spot (say starting at C3).

This was my code so far but it could be rubbish:
Sub Looper()
Dim rng As Range
Dim row As Range
Dim cell As Range
Dim colsheet2 As Range
Set rng = Worksheets("sheet1").Range("E12:AH16")
Set colsheet2 = Worksheets("sheet2").Range("F2:F500")
For Each row In rng.Rows
For Each cell In row.Cells
'do something
Next cell
Next row
End Sub

Please let me know if anyone can help!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
joeyexcelrookie,

Welcome to the MrExcel forum.

What version of Excel and Windows are you using?


So that we can get it right the first time:

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
MrExcel HTML Maker

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

Forum statistics

Threads
1,217,046
Messages
6,134,248
Members
449,862
Latest member
Muhamad Irfandi

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