按钮点击| excel | VBA |的计数增量值 [英] Increment value on basis of count with button click |excel|VBA|

查看:384
本文介绍了按钮点击| excel | VBA |的计数增量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望值在计算时自动打印次数



当计数为5或10 =>时,它很容易使用将单元格拖动到特定计数我们可以得到它



如果计数为100或更多=>然后将单元格拖动到特定的行计数有点无效



单击按钮时数据应自动填充到特定列中的计数



例如:



图片1

点击此处 - >图片 [ ^ ]





如果你看到我的图像,有一些数据和数值就像'DEMO'那样当我输入数字为5时,那么数据中的数据=演示应该多次打印为在Column =>下提到计数。 H $>


输出应如下所示

输出 - > ;图片 [ ^ ]



我尝试过的事情:



我试过这一个但不工作......建议我如何实现这个



 Sub Increment()

Dim startValue
startValue = Cells(15,5)。价值

对于i = 1到10步骤1
单元格(i,5).Value = startValue
startValue = startValue + 1
下一页i
End Sub

解决方案

如何使用Excel SEQUENCE函数| Exceljet [ ^ ]

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

解决方案

How to use the Excel SEQUENCE function | Exceljet[^]


这篇关于按钮点击| excel | VBA |的计数增量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆