0

我试图在一个单元格(B23)上放置一个 activex 文本框,该单元格隐藏了带有安全数据的文本单元格。文本框的密码字符设置为 *。当我将输入框功能放入文本框中时,它会在他们开始输入时弹出,然后当我按下 OK 时,框会清除并要求我重新输入数据,然后它会保存到 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 表已经格式化为显示零。因此,无论我们坚持使用单元格上方的文本框还是其他不同的东西,我都对任何事情持开放态度。

4

1 回答 1

1

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

于 2019-05-10T19:32:08.320 回答