VBA Excel宏将一个输入整数写入单元格 [英] VBA Excel macro writing an input integer into a cell
问题描述
例如,输入框询问您要添加到列表中的作业号问题,然后用户输入FX1234356等参考号。然后,宏需要将该信息写入单元格,然后我可以使用它来完成宏(基本上是在某些数据中搜索)。
您可以使用VBA中的Range对象来设置命名单元格的值,就像任何其他单元格一样。
Range(C1)。Value = Inputbox(您要添加到列表中的工作号)
其中C1是要更新的单元格的名称。
我的Excel VBA有点老且硬硬,所以有可能在更新版本的Excel中做一个更好的方法。
I am writing a quick application myself - first project, however I am trying to find the VBA code for writing the result of an input string to a named cell in Excel.
For example, a input box asks the question "Which job number would you like to add to the list?"... the user would then enter a reference number such as "FX1234356". The macro then needs to write that information into a cell, which I can then use to finish the macro (basically a search in some data).
You can use the Range object in VBA to set the value of a named cell, just like any other cell.
Range("C1").Value = Inputbox("Which job number would you like to add to the list?)
Where "C1" is the name of the cell you want to update.
My Excel VBA is a little bit old and crusty, so there may be a better way to do this in newer versions of Excel.
这篇关于VBA Excel宏将一个输入整数写入单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!