代码复制到 报表 代码窗口,不要弄反了哦Sub 获取数据()x = WorksheetFunction.Match([A1], Sheets("数据").Range("B:B"), 0)arr = Sheets("数据").Range("d" & x & ":" & "h" & x)[b4].Resize(1, 5) = arr[b5] = Sheets("数据").Cells(x, "i")End Sub或Sub 获取数据()y = WorksheetFunction.CountIf(Sheets("数据").Range("B:B"), [a1])If y = 0 ThenMsgBox "日期输入错误"Exit SubEnd Ifx = WorksheetFunction.Match([a1], Sheets("数据").Range("B:B"), 0)arr = Sheets("数据").Range("d" & x & ":" & "h" & x)[b4].Resize(1, 5) = arr[b5] = Sheets("数据").Cells(x, "i")End Sub