如果查找未返回值,则转到标签

时间:2018-07-31 15:00:11

标签: excel vba excel-vba

<select onchange="beerFunction(this)">
  <option>Jelen</option>
  <option>Lav</option>
  <option>Jagodinsko</option>
  <option>Nikšićko</option>
</select><br><br>

<h2>Answer:</h2>
<p id="paragraf">
  <script>
  </script>
</p>

运行此宏时,在 Dim part As String Dim found As Range newPart: Windows("Master Cleaned Kits Oct updated.xlsx").Activate part = InputBox("Enter Part No.", "Part Number Lookup") Set found = Cells.Find(what:=part, After:=ActiveCell, LookIn:=xlFormulas,LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate If found Is Nothing Then msg2 = MsgBox("Error! Invalid part number.", vbOKOnly) GoTo newPart End If Range(ActiveCell, ActiveCell.End(xlDown).Offset(-1)).Select Range(Selection, Selection.End(xlToRight)).Select Selection.Copy 上收到运行时错误424

如果输入的数字不正确或留空,我正在寻找宏以返回到Find标签,以便用户可以尝试再次输入部件号。

0 个答案:

没有答案