vba 通过用户表单将数据插入新行 - Excelvba
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26140752/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Insert data into a new row through a userform - Excelvba
提问by StackUser2014
As the title suggests I am trying to add data into a new row through a userform. The problem I am having is that the layout out is as such:
正如标题所示,我正在尝试通过用户表单将数据添加到新行中。我遇到的问题是布局如下:
Title Jan feb mar apr may jun jul aug sep oct nov dec Total income (Here needs to be where the data is inserted) Outgoing (again, another set of data needs to be added here)
Title Jan feb mar apr may jun jul aug sep oct nov dec 总收入(这里需要插入数据) 输出(同样,这里需要添加另一组数据)
What is the code to achieve this as currently it is going below outgoing but I want it in between income and outgoing
实现这一目标的代码是什么,因为目前它低于传出但我希望它介于收入和传出之间
I am happy to discuss if you need more information.
如果您需要更多信息,我很乐意讨论。
Thanks in advance
提前致谢
回答by AnalystCave.com
You provided too little details with what you are exactly struggling. I can suggest the following: 1. Create a UserForm with as the columns as textboxes. 2. Add a button to the UserForm. When clicked find the last row in the worksheet (http://www.ozgrid.com/VBA/ExcelRanges.htm) and insert the values from each textbox.
你提供的细节太少,说明你到底在挣扎什么。我可以提出以下建议: 1. 创建一个用户窗体,其中的列作为文本框。2. 在用户窗体中添加一个按钮。单击后,在工作表 ( http://www.ozgrid.com/VBA/ExcelRanges.htm) 中找到最后一行并插入每个文本框中的值。
Here are some links to get you started:
以下是一些可帮助您入门的链接:
- UserForms: http://www.excel-easy.com/vba/userform.html
- Manipulating cells: http://msdn.microsoft.com/en-us/library/office/ff838238(v=office.15).aspx