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. Image for the cookie policy date
close icon

Assigning number formats to ranges. (EntireColumn)

Two questions: Is there are particular order in which to assign a number format to a cell? Or could there be an issue using EntireColumn to assign number formats? For example, what I''m trying to accomplish is the following: // Format Columns mySheet.Range[ "A1" ].EntireColumn.NumberFormat = "@"; mySheet.Range[ "B1:C1" ].EntireColumn.NumberFormat = "mm/dd/yyyy"; mySheet.Range[ "D1" ].EntireColumn.NumberFormat = "@"; mySheet.Range[ "E1:F1" ].EntireColumn.NumberFormat = "#,##0.00"; mySheet.Range[ "G1:H1" ].EntireColumn.NumberFormat = "@"; mySheet.Range[ "I1" ].EntireColumn.NumberFormat = "0.000"; mySheet.Range[ "J1" ].EntireColumn.NumberFormat = "mm/dd/yyyy"; mySheet.Range[ "K1:P1" ].EntireColumn.NumberFormat = "#,##0.00"; mySheet.Range[ "Q1" ].EntireColumn.NumberFormat = "@"; mySheet.Range[ "R1" ].EntireColumn.NumberFormat = "#"; ---- I''ve tried doing this before inserting data and also after. If I assign a number format to a particular cell, I have no issues. I use the following code to do this: mySheet.Range[ currentRow,14 ].NumberFormat = "#,##0.00"; Thanks for your help.

Loader.
Live Chat Icon For mobile
Up arrow icon