Vba to copy the data in a column multiple times

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

Ok So
Range C9:C29 holds Employee Names
And
Range E9:E29 holds the number of Months they have been wityh us

I'd like a macro that when run take each name in Range C9:C29

and pastes it into column Z from row 5 down, the number of times they have been with us shown in Range E9:E29
so if Bob has been with use 5 month you would have "BOB" in C "5" in E and we would get 5 rows of bob in Z
and so on

please help if you can
Thanks
Tony
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi Everyone,

Ok So
Range C9:C29 holds Employee Names
And
Range E9:E29 holds the number of Months they have been wityh us

I'd like a macro that when run take each name in Range C9:C29

and pastes it into column Z from row 5 down, the number of times they have been with us shown in Range E9:E29
so if Bob has been with use 5 month you would have "BOB" in C "5" in E and we would get 5 rows of bob in Z
and so on

please help if you can
Thanks
Tony
So if C5="BOB", and E5=5, and Z5:Z10="bob", where does C6="PHIL", E6=10 go? It can't go to Z6:Z16 because Z6:Z10 already have "bob"? Perhaps if you said what the purpose of Column Z is or posted a sample (using XL2BB) of the data and result, it would help. Also, are you talking about months this year, or total months? Someone there for 3 years will need 36 results. I'm confused!
Since you have 365, you might want to try putting the original data in an Excel Table too.
 
Upvote 0
Hi,
Didn't realise this was unclear but after reading it back maybe I could have worded it better
here's a very basic example
as you see Bob goes in Z5:Z10
Phil Would go in Z11:Z21
And the next name Z22 etc.
hope that helps as I'm really stuck
Basically, I'm putting each employee's wages into the month they were paid for a check we are doing
I have a list of everything I need
But each employee is only listed once
If I do it manually it will take ages
so what I want to do is get each name as many times as they have been paid which is the number in E
I know this sounds like a strange way to do this but with the data I have it is going to be a huge help so if anyone can help please do
Thanks
Tony
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,582
Members
449,089
Latest member
Motoracer88

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