将UserForm文本框的值传递给单元格 [英] Pass UserForm textbox value to cell

查看:98
本文介绍了将UserForm文本框的值传递给单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

社区,我是适度的新人。我有一个名为Box_One的文本框。这已经在我的用户窗体上设置了。我所要做的只是一个单元格值与文本框中的任何值都一样。



我尝试过以下操作,但不太确定如何正确实现

  Home.Range(A2)。Value = Box_One.Value 


解决方案

如何使用文本框的Change事件来运行所需的代码?像

  Private Sub TextBox1_Change()
Range(BU1)。value = TextBox1.value'指定目标页和单元格
End Sub

我测试了这个真正的快速,它的工作。 / p>

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

解决方案

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屋!

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