Thanks for you help with this. I've got that issue resolved now, it was the "-" in the code that was causing the error. Many thanks : )
I've got an type mismatch error popping up. It's strange, in the test it appears to be working fine in both columns however in the actual application, even with the - taken out it is only filing the values from the first column i.e. "E" (the message box is displaying values from column E and the code is effectively sorting it to its the correct cells). Once it gets to a value in "D" the error occurs. Any ideas?
Sub btnBRDTest()
Dim ddate As Range, cddate As Range
Dim dte As Long, amount As Double, cfinddte As Range, cfindcat As Range
Dim coldte As Integer, rowamt As Integer, cat As String, rowcat As Integer
With Worksheets("BR(D)")
Set ddate = Range(.Range("A607"), .Range("a607").End(xlDown))
For Each cddate In ddate
dte = cddate.Value
If .Cells(cddate.Row, "E") <> "" Then
amount = .Cells(cddate.Row, "E")
MsgBox .Cells(cddate.Row, "E") & "|" & amount
Else
amount = .Cells(cddate.Row, "D")
End If
cat = .Cells(cddate.Row, "H")
With Worksheets("DACF (DCard)")
Set cfinddte = .Range("OF2").EntireRow.Cells.Find(what:=cddate, lookat:=xlWhole)
If Not cfinddte Is Nothing Then coldte = cfinddte.Column
Set cfindcat = .Range("A5").EntireColumn.Cells.Find(what:=cat, lookat:=xlWhole)
If Not cfindcat Is Nothing Then rowcat = cfindcat.Row
.Cells(rowcat, coldte) = amount
End With
Next cddate
End With
End Sub
Bookmarks