I have an Excel VSTO file that makes a chart with the help of the data entered.
Whenever a cell gets a value ‘e’ it sums the value of all other cells and displays the result in that cell.
I want the cell to keep showing the value ‘e’ instead of the sum that is calculated.
How can I do this?
You can just give the cell a NumberFormat of
"e". This will display
e but not change the underlying value of the cell…
You will need to escape the quotation marks.
Target.NumberFormat = "\"e\"";
(this method will only work if the underlying value of the cell is a number).
Select the cells you want to format and run:
Sub ChangeToText() Dim DQ As String, mesage As String DQ = Chr(34) mesage = DQ & "e" & DQ Selection.NumberFormat = mesage & ";" & mesage & ";" & mesage & ";" End Sub
You will need to adapt this to c#