Can someone give me pointers on how to handle the error in VBA when there is NO match? The code below runs fine otherwise, though I suspect there are more efficient ways to go about this. Thanks in advance. Mike
Sub Beta_Report()
Dim LastCell As Long
Dim MatchRow As Long
Dim iCount As Integer
LastRow = Cells(Rows.Count, 2).End(3).Row
For iCount = 1 To LastRow
If Not IsEmpty(Sheets("AA-beta-F").Cells((11 + iCount), 2).Value) Then
LUFund = Sheets("AA-beta-F").Cells((11 + iCount), 2).Value
MatchRow = WorksheetFunction.Match(LUFund, Sheets("Summary").Range("B:B"), 0)
Sheets("AA-beta-F").Cells((11 + iCount), 1).Value = MatchRow
Sheets("AA-beta-F").Cells((11 + iCount), 11).Value = Sheets("Summary").Cells(MatchRow, 9).Value
Sheets("AA-beta-F").Cells((11 + iCount), 15).Value = Sheets("Summary").Cells(MatchRow, 12).Value
Sheets("AA-beta-F").Cells((11 + iCount), 17).Value = Sheets("Summary").Cells(MatchRow, 10).Value
Else
End If
Next iCount
End Sub
Sub Beta_Report()
Dim LastCell As Long
Dim MatchRow As Long
Dim iCount As Integer
LastRow = Cells(Rows.Count, 2).End(3).Row
For iCount = 1 To LastRow
If Not IsEmpty(Sheets("AA-beta-F").Cells((11 + iCount), 2).Value) Then
LUFund = Sheets("AA-beta-F").Cells((11 + iCount), 2).Value
MatchRow = WorksheetFunction.Match(LUFund, Sheets("Summary").Range("B:B"), 0)
Sheets("AA-beta-F").Cells((11 + iCount), 1).Value = MatchRow
Sheets("AA-beta-F").Cells((11 + iCount), 11).Value = Sheets("Summary").Cells(MatchRow, 9).Value
Sheets("AA-beta-F").Cells((11 + iCount), 15).Value = Sheets("Summary").Cells(MatchRow, 12).Value
Sheets("AA-beta-F").Cells((11 + iCount), 17).Value = Sheets("Summary").Cells(MatchRow, 10).Value
Else
End If
Next iCount
End Sub