Function VlookupRows(keys, rng As Range, keycol) As Range '单据关键字查找多行数据
Dim i, n
On Error Resume Next
i = Application.Match(keys, rng.Columns(keycol), 0)
n = Application.CountIf(rng.Columns(keycol), keys)
If Err = 0 Then
Set VlookupRows = rng.Cells(i, 1).Resize(n)
Else
Set VlookupRows = Nothing
End If
End Function