Macro to paste a unique count number of times

Closed
pkawale - Updated on Jun 2, 2017 at 04:32 PM
 Blocked Profile - Jun 2, 2017 at 04:38 PM
Hi everyone,

I am trying to create Macro to paste a unique count number of times in excel

for E.g

John 2
Steve 5
Matthew 3
Adam 6
Joe 2

I am expecting a result wherein

John
John
Steve
Steve
Steve
Steve
Steve
Matthew
Matthew
Matthew
Adam
Adam
Adam
Adam
Adam
Adam
Joe
Joe

I have no information about macro kindly help if possible

Regards,
Pratik Kawale


1 response

Blocked Profile
Jun 2, 2017 at 04:38 PM
Take the variable and build a FOR loop, as in:
dim thecount as integer
dim thecounter as integer

thecount=cells(1,1).value

for thecounter = 1 to thecount
Do you code here
next

It is that simple. Pot some code, and we can help! Take a look at this article, it may assist you:
https://ccm.net/faq/53497-how-to-manipulate-data-in-excel-using-vba
0