我的输入框允许用户在单元格中输入一个值。因此,我希望过滤一些输入=SUM(A:A)
,例如'
不会显示任何内容,以及其他公式或可能会影响实际值的条目。提前致谢。
Private Sub testInputBox_Click()
Dim x As String
Dim y As String
Dim yDefault As String
Dim found As Range
x = InputBox("Enter Parts No.", "Edit Description")
If (x <> "") Then
If (WorksheetFunction.CountIf(Worksheets("Sheet1").Range("E2:E27"), x) > 0) Then
Set found = Worksheets("Sheet1").Range("E2:E27").Find(x, LookIn:=xlValues)
yDefault = found.Offset(0, 1).Text
y = InputBox("Amend Description", "Edit Description", yDefault)
Else
MsgBox ("Not found!")
End If
If (y <> "") Then 'Filter should be done here
If MsgBox("Proceed to edit?", vbYesNo, "Confirmation") = vbNo Then
Else
found.Offset(0, 1).Value = CStr(y)
End If
End If
End If
End Sub