basic copy/paste macro needed

neov

Board Regular
Joined
Oct 3, 2003
Messages
67
long time board reader, first question in a while

I have two worksheets. One (#1)worksheet has a list of 431 account numbers.

The other worksheet (#2)has a repeating list of 437 department numbers/org's that I've already copied, 431 times, into it's own column.

What I need to do now is copy each account number (on worksheet 1) 37 times onto worksheet 2, then go back to worksheet 1 - get the next account number - copy that onto worksheet 2 - starting below were I just copied the previous account number.

I need to repeat this 431 times - this is to make an import file that our ERP system can read to block certain combinations of account numbers and org strings from being used together.

Thanks in advance!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
found a solution from Norrie

Code:
Set rng = Sheets("Report").Range("C6")
For Each nm In Range("List_Name")
       rng.Resize(22) = nm.Value
       Set rng = rng.Offset(22)
Next nm

I had to change my 22 to a 37, and of course use a range name - but it works perfectly
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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