我对VBA和编程非常陌生。我试图如下:在特定行中查找inputbox的值,工作表
- 单击命令按钮btnUpdateEntry启动一个输入框
- 搜索页“输出”输入框的值在列A
- 转到第一位置,其中价值发现
显示消息,如果值没有找到
Private Sub btnUpdateEntry_Click() Dim StringToFind As String StringToFind = Application.InputBox("Enter string to find", "Find string") Worksheets("output").Activate ActiveSheet.Range("A:A").Select Set cell = Selection.Find(What:="StringToFind", After:=ActiveCell, _ LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) If cell Is Nothing Then Worksheets("input").Activate MsgBox "String not found" End If End Sub