Copy data and pasting multiple times using macro

Closed
Jlaro Posts 2 Registration date Thursday January 31, 2019 Status Member Last seen January 31, 2019 - Jan 31, 2019 at 11:39 AM
 Blocked Profile - Jan 31, 2019 at 04:03 PM
Hello,

So I am having trouble determining what code to use to past value. The situations is as follows:

On Sheet1 I have a list of names in column A, as well as a list of how many times I need to copy and past the name in column B.
Example: A1= John, B1=15
A2= Larry, B2= 23
A3= Bob, B3= 55
A4= Jeff, B4= 18

What I need is to copy John's name 15 time, Larry's 23, Bob's 55, and Jeff's 18. Then have those names past in Sheet2 column J their respected number of time.
Example End Result: J1-15 will have John's name
J16-38 will have Larry's name and so on...

The values in column B will change on a daily basis.

Thank you for your help!
Related:

1 response

This has no business application, and appears to be a homework assignment. Please complete your own homework, as you will learn nothing if you don't do it yourself.

here is a hint. Build your for loop using the values in the cell. So your loop could be built as:
Thecount = cell ("b2").value
For theloop = 1 to thecount
Do your code here
Next

That should give you a good head start.

0
Jlaro Posts 2 Registration date Thursday January 31, 2019 Status Member Last seen January 31, 2019
Jan 31, 2019 at 02:32 PM
This is for business. I'm looking to be able to assign work item to individuals. The number of items changes on a daily basis (column B). An there are several thousand items so trying to manually enter can copy/past is not efficient.
0
Can you build a for loop?
0