Ignore the questions in my previous post, unless the suggestion below does not work.
I assume the transactions are downloaded from a web site. In that circumstance, cells that appear blank are often in fact not blank. Instead they contain some non-visible character. I suspect the results of the formulas suggested in my previous post would confirm that and that would be why the formulas you have been trying have been returning errors when column F appears blank.
Following from my earlier point about the number of rows required. I cannot imagine that the transaction list could need anything like 65,000 rows.
So try this code. It has two points to note:
1. We find the last row of data (by searching upwards from the bottom of columns F:G until we find some data) and then just fill the formula in those rows. Then there should be no need to subsequently go deleting rows that contain 0.
2. By using SUM() in the formula, we should avoid any problems with non-visible text characters in the cells since SUM() ignores text values.
<font face=Courier New><br><SPAN style="color:#00007F">Sub</SPAN> Fill_Formula()<br> <SPAN style="color:#00007F">Dim</SPAN> LastRow <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br> <br> <SPAN style="color:#007F00">'Find the last row in cols F,G with data</SPAN><br> <SPAN style="color:#00007F">With</SPAN> Columns("F:G")<br> LastRow = .Find(what:="*", After:=.Cells(1, 1), _<br> LookIn:=xlValues, SearchOrder:=xlByRows, _<br> SearchDirection:=xlPrevious, SearchFormat:=False).Row<br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br> <br> <SPAN style="color:#007F00">'Just fill those rows with a formula</SPAN><br> <SPAN style="color:#00007F">If</SPAN> LastRow > 1 <SPAN style="color:#00007F">Then</SPAN><br> Range("I2:I" & LastRow).Formula = "=SUM(G2)-SUM(F2)"<br> <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>