我正在尝试将一个 activex 文本框放在一个单元格 (B23) 上,该单元格使用安全数据隐藏文本单元格。文本框的 passwordchar 设置为 *。当我将输入框功能放入文本框中时,它会在他们开始输入时弹出,然后当我按下确定时,该框会清除并要求我重新输入数据,然后将其保存到 B23。有没有办法在第一次完成这项工作,或者如果在第二个弹出窗口中说“请验证您的输入”?
我试过将单元格链接到 B23 并关闭范围,但它没有存储数据。
Private Sub TextBox1_Change()
Dim response As String
response = InputBox(Prompt:="Please enter the EIN/Tax Payer ID with no dashes or spaces. For security purposes this information will disappear after entry and be stored securely.", Title:="Tax Payer Data", Default:="Enter Tax Payer ID here")
Range("B23").Value = response
Exit Sub
End Sub
有没有办法在第一次完成这项工作,或者如果在第二个弹出窗口中说“请验证您的输入”?我试图在输入后隐藏敏感数据(EIN、银行帐号等),但保留起始“0”并且 Excel 工作表已经格式化为显示零。因此,无论我们坚持使用单元格上的文本框还是其他不同的东西,我都愿意接受任何事情。
GotFocus 活动应该可以帮助您
Private Sub TextBox1_GotFocus()
Dim response As String
response = InputBox(Prompt:="Please enter the EIN/Tax Payer ID with no dashes or spaces. For security purposes this information will disappear after entry and be stored securely.", Title:="Tax Payer Data", Default:="Enter Tax Payer ID here")
Range("G1").Value = response
TextBox1.Text = response
Exit Sub
End Sub
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句