我對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