在用户窗体上显示单元格范围;然后更新 [英] Show Cell Range on UserForm; then update

查看:52
本文介绍了在用户窗体上显示单元格范围;然后更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用粗略的方法来帮助用户更新某些单元格-通过将它们放在工作表中.我有什么办法可以在用户表单中逐个显示各种范围,然后让用户更新它们,单击一个按钮并移至下一个?

I've been using a crude method to help the user update some cells - by having them in a sheet. Is there any way I can display the various ranges in a userform, one by one, then have the user update them, click a button and move onto the next one?

从本质上讲,我可以让Excel根据范围自动生成输入表单吗?更新并保存回我可以做的工作表的过程;这是我无法做到的正确形式的产物.

Essentially, can I have Excel automatically generate an input form based on a range? The process of updating and saving back to the sheet I can do; it's the production of the correct form that I can't.

推荐答案

可以做到这一点,但我能想到的唯一方法是制作一个基于传入范围自动填充自身的用户窗体.这样,您在Excel中可能具有不同的宏,这些宏会根据不同的范围调用表单进行填充.我建立了一个概念证明Excel文件来尝试这一操作,它似乎可以正常工作,我能想到的唯一问题是,您需要找出一种方法来告诉用户什么输入字段是什么.

It's possible to do this, but the only way I can think of is to make a userform that automatically populates itself based on a range passed in. This way you could have different macros in Excel that call the form to populate based on different ranges. I built a proof of concept Excel file for trying this, and it seems to work, the only issue I can think of being that you need to figure out a way to tell the user what input field is what.

我认为需要做的是以编程方式将控件添加到用户窗体(我将文本框命名为要填充的单元格地址),然后在窗体关闭时循环遍历所有文本框,并用文本框填充单元格值.

I think what needs to be done is to add controls programmatically to a userform (I name the textboxes as the cell address it's going to populate) then when the form is closed loop through all the textboxes and populate the cells with the textbox values.

您可以在以下位置看到我的工作: https://my.syncplicity.com/share/uicgbs3rl0/InputForm.xls

You can see what I did at: https://my.syncplicity.com/share/uicgbs3rl0/InputForm.xls

我认为所有需要做的就是让您确定如何为文本框添加标签,并确保根据添加的控件调整表单的大小...

I think all that would need to be done is for you to work out how to add labels for the textboxes, and make sure the form is resized based on the controls you add...

这篇关于在用户窗体上显示单元格范围;然后更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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