我已将用户表单添加到Excel电子表格中,该电子表格会向用户询问问题并将其添加到电子表格中的新行 .
电子表格中的每一列都有自己的公式,可根据用户输入进行计算 .
有没有一种方法可以让我自动将列中连续的公式“拉”到添加的行中?
我想我可以在我的用户表单的代码中更改它,所以当一个人点击“提交”时,所有单元格都会更新 . 但我只知道如何更新值,而不是添加公式 . 这是我的代码的一部分:
.Cells(iRow, 6).Value = Me.TextBox1.Value
.Cells(iRow, 7).Value = Me.TextBox2.Value
.Cells(iRow, 8).Value = Me.TextBox3.Value
.Cells(iRow, 9).Value = Me.TextBox4.Value
.Cells(iRow, 10).Value = Me.TextBox5.Value
.Cells(iRow, 11).Value = Me.TextBox6.Value
.Cells(iRow, 12).Value = Me.TextBox7.Value
.Cells(iRow, 13).Value = Me.TextBox8.Value
.Cells(iRow, 14).Value = Me.TextBox9.Value
.Cells(iRow, 15).Value = Me.TextBox10.Value
是否可以添加一些东西来改变单元格值1-4?也许是这样的:
.Cells(iRow, 1).Value = *insert formula here*