Tag: 提示

Excel VBA:编辑单元格时创build确认提示

我正在尝试创build一个确认,以便在单元格为空时提示启动。 如果用户单击确认,单元格保持空白,否则单元格返回到原始值。 我有以下但它不工作,我希望有人可以解决这个问题: Private Sub MYtest() Dim vatcell As Range Set vatcell = Worksheets("Invoice").Range("D11:D11") If vatcell = "" Then response = MsgBox("Are you sure you want to change the VAT ammount?" & Chr(10) & Chr(10) _ & "Value = " & vatcell & Chr(10) & Chr(10) _ & "Do you really want to change it?", […]

文件打开提示function代码不工作 – 不知道为什么

我有一个Sub ImportTest1()调用function文件(path)。 导入子似乎工作正常,但我不能确定,因为function部分不起作用,当涉及到设置QueryTable的东西打开文本文件到Excel工作表。 下面的代码是我现在所拥有的(粗体部分是不工作的位),我不确定那是什么错误。 Sub ImportTest1() Dim path As String 'CALL TO OPEN FILE DIALOG BOX path = opener() If path = "" Then Exit Sub End If 'CALL TO FILE OPEN FUNCTION files (path) End Sub Function opener() Dim sFile As String With UserForm1.CommonDialog1 .Filter = "All Files (*.*)|*.*" .ShowOpen If Len(.FileName) = 0 […]