In Excel, in order to enhance the contrast of the active cell, sometimes we need to modify its background color, font, font size, and so on, to differentiate and other cell contrast!
In this tutorial, let's learn how to make Excel active cells have the background
When using EXCEL to process data, it is a good choice to add a background color to cells to clearly mark cells that meet specific conditions. Manual processing is simple and quick, but it takes a lot of time and effort to handle large volumes of data ). Code processing is a good choice. Excel can process internal data through
In Excel, using the simple visualization method is difficult to filter by color, so we can only use VBA code to implement it.
The following code has the function of hiding the column data of the current cell with the row of the current cell in addition to the first row, the header column of the data.
If you have other requirements, please modify the code yourse
sort the table data by the font color in the Excel cell
The product name listed in the following figure has four different colors, sorted according to the color sequence you want, such as "gray-green-blue-red".
1. Select any cell in the table, switch to the Data tab, and in the Arrange and filter group,
For Microsoft Excel 97-2003 worksheet (.xls)
If (31 = cell. getcellstyle (). getfillforegroundcolor () // determines whether the foreground color of a cell is pale blue. If (10 = book. getfontat (cell. getcellstyle (). getfontindex ()). getcolor () // determines whether the cell font color is red.For Microsoft
,
Writablefont.bold, False, Underlinestyle.no_underline,
Jxl.format.Colour.CORAL); Define formatting font underline italic bold color
Writablecellformat WCF = new Writablecellformat (WF); Cell definition
Wcf.setbackground (Jxl.format.Colour.BLACK); Set the background color of a cell
Wcf.setalignment (Jxl.format.Alignment.CENTRE); To set alignment
Sheet.addcell (
In the morning, the press called to inform you that the book has been officially published. After reading the second bookstore, you can order it now, but the status is out of stock. If you need it, you can order it. It is estimated that each bookstore can see it in a month.
Order: http://www.dearbook.com.cn/book/110873Http://www.dangdang.com/product/9201/9201169.shtml
Chapter 2 Introduction to excel and VB
file needs multiple worksheet, then can be saved in xls/xlsx format, the corresponding read and write operation with the XLRD and Openpyxl mentioned above.
The second type, the operation of the file not only read and write data, including more other operations, such as inserting rows and columns, setting font color, wait. The file format must be the Excel only
: Network Disk DownloadContent Introduction······For most professionals who do not have a foundation for programming, they tend to have a lot of fear in learning VBA. This book is aimed at such a crowd, with easy-to-understand language and vivid image of the metaphor, and with a large number of illustrations, the seemingly complex concepts and code in Excel, from simple macro recording,
Recently, I have learned how powerful VBA is to modify an Excel report. This report was written by Daniel three years ago. Just open this file every day, the Dev and UAT databases in Oracle are automatically connected to read the latest market data and six perspectives are generated, compare the data similarities and differences between Dev and UAT. The convenience of using
The VBA basics are coming to an end in everyone's attention. There are many classic VBA operations that we just briefly introduce, to use VBA skillfully, You need to digest and absorb it slowly, and then summarize and improve it in practice. Finally, we collected common VBA code to attract a large number of readers and
(1) create a form in VBA, initialize its location, and call it...
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Sub CallForm ()UserForm1.Show 'display formUserForm1.Left = 600 'display positionUserForm1.Top = 180End SubPrivate Sub commandbutton#click ()CallForm 'callEnd Sub
(2) font color and background
// Newtable. Cell (1, 1). range. Text = "product details table \ n \ r ssdfgdfg \ n \ r "; // Newtable. Cell (1, 1). range. Bold = 2; // Set the cell font to bold /// /Fill in the table content // Newtable. Cell (1, 1). range. Text = "product details table \ n \ r d \ n \ r "; // Newtable. Cell (1, 1). range. Bold = 2; // Set the cell font to bold Object Dirc = Microsoft. Off
Purpose : Sometimes we need to organize a large amount of data in an Excel file, which can be tedious and error-prone if you use manual grooming. In the case of VBA, it is possible to automate a large amount of data collation by writing a simple code in Excel based on requirements.1, in Excel 2007, for example, if you
the cell font20objspreadsheet. cells (irow, icol). Font. colorindex = 2' sets the color of the cell text. The color can be queried, and 2 is white.21objspreadsheet. Range ("A1: F1"). merge' merge cells (unit area)22objspreadsheet. Range ("A1: F1"). Interior. colorindex = 1' background color of the design unit Network2
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.