Problem when adding a new column and writing a formula


I have a problem when inserting a new column to my excel spreadsheet and thereafter writing a formula in the newly added column. The formula is inserted as text and not the value (as you see in the attached file). Furthermore, the formula will not change as if you drag the first cell manually in excel. The code worked when I did not insert a new column.
Do you have any good solutions to this problem?


Make sure the range should be correct and the formula should be in double quotes and if you can share the code and excel i can try helping you more in this.


I cannot upload any file because I am a new user and unfortunately I cannot share the excel file because it contains confidential information. Can you please explain the double quotes? Thanks!

You can have this code as reference for adding the formula into your excel sheetSum C.xaml (7.3 KB)
Sums.xlsx (8.2 KB)

1 Like

I will have a look at it. Thank you so much for your help!

The “Sum” code did not work but I managed to upload my code.

Ensured prøve.xaml (9.5 KB)