如何将值从单元格传递给用户窗体中的文本框?

我试过使用这个代码,但它不工作。

UserForm2.txtEcpNum.Value = Worksheets("Sheet3").Range("B2").Value 

像这样的东西应该工作:

 UserForm2.txtEcpNum.Text = CStr(Range("B2").Value) UserForm2.Show 

UserForm2.txtEcpNum.Value简单地replaceUserForm2.txtEcpNum.Value也可以,但我不是100%确定的