【问题标题】:Input box prompting for second data entry to store data, can we make it store on the first entry?输入框提示输入第二个数据来存储数据,我们可以让它存储在第一个条目上吗?
【发布时间】:2019-05-10 19:11:32
【问题描述】:

我正在尝试在单元格 (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 表已经格式化为显示零。因此,无论我们坚持使用单元格上方的文本框还是其他不同的东西,我都对任何事情持开放态度。

【问题讨论】:

    标签: excel vba inputbox


    【解决方案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
    
    

    【讨论】:

    • 这让我很开心!!非常感谢!
    • 作为替代方法,请参阅此链接support.office.com/en-us/article/…。请注意,您不应该将客户数据保存在普通的 Excel 中
    • 这个文件一旦完成就会被锁定。为了安全起见,我们还将 B23 送入隐藏和锁定的床单。当我做“;;;”它删除了起始零。
    • 我不会永远相信 Excel 会处理敏感数据。它的安全性存在漏洞。
    猜你喜欢
    • 2014-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-02
    • 2021-08-17
    • 2021-05-27
    • 1970-01-01
    相关资源
    最近更新 更多