Pass UserForm textbox value to cell

2019-03-06 08:16发布

问题:

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

回答1:

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.