We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

IWorksheet Range - Select All Cells > Right-click > Format Cells > Text

Thread ID:





105099 Sep 7,2012 02:13 PM UTC Sep 10,2012 06:31 AM UTC ASP.NET Web Forms (Classic) 2
Tags: XlsIO
Adam Woodcock
Asked On September 7, 2012 02:13 PM UTC

We have a legacy pivot table report that requires all cells to be formatted as text.  I'm trying to make sense of the following documentation but having trouble -


Basically, the manual steps in Excel would be

  1. Select All Cells
  2. Right-click > Format Cells
  3. Select "Text" format

Thanks for your assistance.

Adam Woodcock
Replied On September 7, 2012 03:14 PM UTC

Once I had my IWorksheet defined.  Applying myWorkSheetName.Range.NumberFormat = "@" is what I was looking for.  

Now when I right-click in Excel > Format Cells, its applying the desired formatting.

Rajesh A [Syncfusion]
Replied On September 10, 2012 06:31 AM UTC

Hi Adam,

Thank you for using the Syncfusion Products.

To apply the desired numberformat to all cells then, we need to mention the range. Please refer to the below code snippet which illustrates this. Also we have attached sample for you reference. Could you please try this and let us know if this helps you.

Case 1. //If we use the below code, blank cells has no effect.

      sheet.Range.NumberFormat = "@";

Case 2.  //Setting Number Format as Text.

      //WE need to mention the specified Range.         

      sheet.Range["A1:XF1000"].NumberFormat = "@";

Please find the sample for "formatting cells" from the below link and let us know if this helps you.

Sample link: Sample

Please let us know if you need any clarification.

Thanks and Regards,

Rajesh A.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon