Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Apr 14, 2022 3:16 pm

Hi,
I am using Spire.xls via NuGet package in c# and trying to achieve a scenario where ,
I have to show the actual value in the formula bar and the modified value in the cell.

for example, If have a value such as 74.8 then I have to show 74.8 in the formula bar and 75 in the cell value (after rounding it)
How I can achieve it.

Screenshot is attached for more reference.
Attachments
icebluequestion.png
icebluequestion.png (88.84 KiB) Viewed 509 times

ankitch656
 
Posts: 2
Joined: Tue Apr 12, 2022 8:41 pm

Fri Apr 15, 2022 6:42 am

Hi,

Thank you for your inquiry,
Please refer to the following code to achieve your need. If you have any questions, please feel free to contact us.
Code: Select all
sheet.Range["A1"].NumberValue = 0.748;
sheet.Range["A1"].NumberFormat = "0%";

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Fri Jul 08, 2022 7:20 am

Hi,

Hope you are doing well!
Has your problem been effectively solved now? Could you give us some feedback at your convenience?
Thanks in advance.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.XLS