It's seeing the data, it's placing '0' integers in the cells.
The first cell row source in the argument places the actual values in the required sheet i.e. E to D it places the E values and leaves a D as 0 and the inverse is also true.
Sub test()
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("Transactions")
Set ddate = Range(.Range("A2"), .Range("a2").End(xlDown))
For Each cddate In ddate
dte = cddate.Value
If .Cells(cddate.Row, "E") <> "-" Then
amount = .Cells(cddate.Row, "D")
Else
amount = .Cells(cddate.Row, "E")
End If
cat = .Cells(cddate.Row, "F")
With Worksheets("Table2")
Set cfinddte = .Range("B1").EntireRow.Cells.Find(what:=cddate, lookat:=xlWhole)
If Not cfinddte Is Nothing Then coldte = cfinddte.Column
Set cfindcat = .Range("A2").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
Also, apologies. I'll be more comprehensive next time.
Bookmarks