VBA code to copy and paste data multiple times

lakshminair - Sep 19, 2018 at 11:05 AM - Latest reply: ac3mark 10647 Posts Monday June 3, 2013Registration dateModeratorStatus October 15, 2018 Last seen
- Sep 19, 2018 at 04:11 PM
Hello,

is it possible to parse a column and find a value in it, and copy and paste a particular range based on that value in the previous range? the value is the multiplier which tells how many times the range should be pasted.

and i need this to repeat everytime.
See more 

Your reply

1 reply

ac3mark 10647 Posts Monday June 3, 2013Registration dateModeratorStatus October 15, 2018 Last seen - Updated by ac3mark on 19/09/18 at 04:11 PM
0
Thank you
Yes this is possible.

Here are some code examples that will assist in the inspection of cell values:

WS="Sheet1"
theCellValue = ThisWorkbook.Worksheets(WS).Range("A4").value


Then, if the value is being stored in the cell, you would loop by the variable, as in:
for theloop = 1 to theCellValue
MsgBox("The Counter is on " & theloop & " of " & theCellValue)
next


There you have it!

Respond to ac3mark