I have a workbook (Tracking Sheet) with lots of macros in it. These macros update 2 other workbooks (Commercial_Work_log and Proofer Payment Record) and as well as the Tracking Sheet itself.

I'm having problems with one particular macro which I'm trying to amend to be bit more reliable. The code is:

Sub PostToProoferPayment()
If Range("D3").Value = "" Then Exit Sub
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Set WS1 = Worksheets("Tracking Sheet")
Workbooks.Open "G:\READERS FEES\Proofer Payment Record.xlsx"
Set WS2 = Worksheets("Payment")

' Figure out which row has the job nr
findrow = Application.Match(WS1.Range("D2"), Range("B:B"), 0)
If Not IsError(findrow) Then
' Write the important values to the Commercial Tracker
WS2.Cells(NextRow, 1).Resize(1, 6).Value = Array(WS1.Range("G32"), WS1.Range("D2"), WS1.Range("D3"), WS1.Range("D1"), WS1.Range("B1"), WS1.Range("H58"))
Else
  ' Figure out which row is the next row
NextRow = WS2.Cells(Rows.Count, 1).End(xlUp).Row + 1
' Write the important values to the Proofer Payment Record
WS2.Cells(NextRow, 1).Resize(1, 6).Value = Array(WS1.Range("G32"), WS1.Range("D2"), WS1.Range("D3"), WS1.Range("D1"), WS1.Range("B1"), WS1.Range("H58"))
End If
When I run it I get an Application Defined or Object Defined error but being a VB NEWBIE I don't really know why.

This is what I want it to do.

1. If D3 in the Tracking Sheet is empty it does nothing.
2. If D3 in the Tracking sheet isn't empty it should check to see if the job number in D2 of the Tracking Sheet appears anywhere in column B of the Proofer Payment Record
3. If the job number does appear in Column B it should copy Cells G32, D2, D3,D1, B1, H58 from the tracking sheet into the row with that job number in replacing the existing data.
4. If the job number doesn't appear in Column B it should create a new row at the bottom of the Proofer Payment Record and then copy cells G32, D2, D3,D1, B1, H58 from the tracking sheet into the new row