Click here to Skip to main content
15,065,044 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want the Value should be Auto Printed Number of Times When Count is Given

it is easy when the Count is 5 or 10 => using Dragging the cell upto particualr count we can get it

what if the count is 100 or more => then Dragging the cell upto that particular row count is bit not effective

when a button is clicked the Data should be auto filled upto that Count in a particular Column

for example :

Image 1
Click here -> Image[^]


If you see my image there is Count and Value as some Data like 'DEMO' When i enter count like 5 then the Data in Value = Demo should be printed that many times as Count is mentioned Under Column => H

Output should be like this Below
Output -> Image[^]

What I have tried:

I have tried this one But not Working ... Suggest me How do i achieve this

Sub Increment()

Dim startValue
startValue = Cells(15, 5).Value

For i = 1 To 10 Step 1
    Cells(i, 5).Value = startValue
    startValue = startValue + 1
Next i
End Sub
Posted
Updated 25-Jul-20 14:43pm

Sub Increment()
'jitenforme@gmail.com +919718948427(WhatsApp No)
Dim startValue, ToValue
startValue = Cells(5, 6).Value
ToValue = Cells(5, 3).Value + 4

For I = 5 To ToValue Step 1
Cells(I, 8).Value = startValue
startValue = startValue + 1
Next I
End Sub
   
Comments
CHill60 27-Jul-20 6:13am
   
An uncommented, unformatted code dump is not a solution.
Leaving your email and contact details exposed in an open forum is laying out an invite to spam bots and the like - I advise you to remove them from your post

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900