C # Set the Excel cell format

Source: Internet
Author: User

C # operate Automatic Filling of Excel cells, center alignment, and font color settings

 

// Set the title in Excel. range titlerange = worksheet. get_range (worksheet. cells [1, 1], worksheet. cells [1, columncount]); // select a cell and titlerange of one or more rows. merge (true); // merge the cell titlerange. value2 = strtitle; // set the text titlerange in the cell. font. name = ""; // set the titlerange font. font. size = 18; // font size titlerange. font. bold = true; // bold to show titlerange. horizontalalignment = excel. xlhalign. xlhaligncenter; // titlerange in the horizontal center. verticalalignment = excel. xlvalign. xlvaligncenter; // vertically centered titlerange. borders. linestyle = excel. xllinestyle. xlcontinuous; // set the border titlerange. borders. weight = excel. xlborderweight. xlmedium; // regular Border Width

 

 

Reference: http://blog.csdn.net/zhaobisha/article/details/3862568
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.