将 UserForm 文本框值传递给单元格 [英] Pass UserForm textbox value to cell
本文介绍了将 UserForm 文本框值传递给单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
社区,我对 excel 还不太熟悉.我有一个名为 Box_One 的文本框.这已在我的用户表单上设置.我想要做的就是让单元格值始终等于文本框中的任何值.
Community, I'm moderately new to excel. I have a textbox called Box_One. This has been set up on my userform. All I want to do is have a cell value constantly equal whatever value is in the textbox.
我尝试了以下,但不太确定如何正确实施
I tried the following, but not quite sure how to implement properly
Home.Range("A2").Value = Box_One.Value
推荐答案
使用你的文本框的 Change 事件来运行你想要的代码怎么样?类似的东西
how about using the Change event of your text box to run the code you want? Something like
Private Sub TextBox1_Change()
Range("BU1").value = TextBox1.value ' specify the destination sheet and cell here
End Sub
我对此进行了快速测试,它确实有效.
I tested this real quick and it worked.
这篇关于将 UserForm 文本框值传递给单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文