diff --git a/src/view/grid/GridAccount.cpp b/src/view/grid/GridAccount.cpp
index c0935ce..d7756ba 100644
--- a/src/view/grid/GridAccount.cpp
+++ b/src/view/grid/GridAccount.cpp
@@ -302,6 +302,9 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
 	_fixCosts++;
     }
 
+    SetCellEditor(line, DEBIT, new wxGridCellFormulaEditor(op.formula));
+    SetCellEditor(line, CREDIT, new wxGridCellFormulaEditor(op.formula));
+
     if (op.id.Length())
     {
         cat = user->GetCategory(op.category);
@@ -316,9 +319,6 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
         else
             SetCellValue(line, CREDIT, wxString::Format(wxT("%.2lf"), op.amount));
 
-	SetCellEditor(line, DEBIT, new wxGridCellFormulaEditor(op.formula));
-	SetCellEditor(line, CREDIT, new wxGridCellFormulaEditor(op.formula));
-
 	if (!op.meta)
 	    SetCellValue(line, ACCOUNT, user->GetAccountName(op.account));
         if (!fix && !op.meta)
@@ -638,7 +638,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
         value.ToDouble(&new_op.amount);
         new_op.amount *= -1.0;
         op_complete--;
-	wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, col);
+	wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, DEBIT);
 	new_op.formula = pEditor->GetFormula();
 	pEditor->DecRef();
     }
@@ -648,7 +648,7 @@ void GridAccount::OnOperationModified(wxGridEvent& event)
     {
         value.ToDouble(&new_op.amount);
         op_complete--;
-	wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, col);
+	wxGridCellFormulaEditor* pEditor = (wxGridCellFormulaEditor*) GetCellEditor(row, CREDIT);
 	new_op.formula = pEditor->GetFormula();
 	pEditor->DecRef();
     }