我正在通過下面的腳本來最終從數據查詢中將一系列數據從基於在inputbox
中輸入的值中抽取到單獨的工作表中,但是我一直遇到424錯誤 - 對象需要。424對象VBA查找所需的錯誤
爲了測試是否這工作我想顯示一個消息框,以便然而腳本保持在Vlookup
Private Sub Workbook_Open()
Dim NextRelease As String
If MsgBox("Would you like to promote the next release in batch?", vbQuestion + vbYesNo, "Promote the next release?") = vbYes Then
NextRelease = InputBox("Please enter the date of the next release", "Next Release", "DD/MM/YYYY")
ReleaseDate = Application.WorksheetFunction.VLookup(NextRelease, TRELINFO.Range("A2:B4"), 1, False)
If NextRelease = ReleaseDate Then
MsgBox ("Working")
請未能有人能提供一個答案,爲什麼這我就可以開始下一階段正在發生並有望解決這個問題。 提前謝謝!
什麼行是錯誤出現在? –
'TRELINFO'這是錯誤。你有任何代碼名稱爲「TRELINFO」的工作表,或者你有一個工作表類型變量設置爲任何工作表? – cyboashu
@cyboashu - 工作表名稱爲TRELINFO,數據查詢也命名爲TRELINFO。爲了避免混淆,我現在已將表格暫時重命名爲TRELINFO2,但同樣的錯誤正在返回。 – Paul