Option Explicit
Sub Macro1()
Dim lngEndRow As Long
Dim rngMyCell As Range
Dim rngMatchCell As Range
Application.ScreenUpdating = False
lngEndRow = Range("A:B").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
For Each rngMyCell In Range("A1:A" & lngEndRow)
If Val(rngMyCell) > 0 And rngMyCell.Font.Bold = False Then 'Only try and match the first reference if its amount is positive
For Each rngMatchCell In Range("A1:A" & lngEndRow)
If Val(rngMatchCell) * -1 = Val(rngMyCell) And rngMatchCell.Offset(0, 1) = rngMyCell.Offset(0, 1) Then
rngMyCell.Offset(0, 2).Value = rngMyCell 'Move original amount
rngMatchCell.Offset(0, 2).Value = rngMatchCell 'Move matched amount
rngMyCell.Offset(0, 3).Value = rngMyCell.Offset(0, 1) 'Move original reference number
rngMatchCell.Offset(0, 3).Value = rngMatchCell.Offset(0, 1) 'Move matched reference number
Range("A" & rngMyCell.Row & ":B" & rngMyCell.Row).ClearContents
Range("A" & rngMatchCell.Row & ":B" & rngMatchCell.Row).ClearContents
Exit For
End If
Next rngMatchCell
ElseIf Val(rngMyCell) < 0 Then
rngMyCell.Font.Bold = True
For Each rngMatchCell In Range("A1:A" & lngEndRow)
If Val(rngMatchCell) * -1 = Val(rngMyCell) Then
rngMatchCell.Font.Bold = True
Exit For
End If
Next rngMatchCell
End If
Next rngMyCell
Application.ScreenUpdating = True
End Sub