[090] basics of Excel VBA

Source: Internet
Author: User

Excel Object Model:

  • Application Object (Excel): Stab Me !!!
  • Font Object (Excel): Stab Me !!!
  • Worksheet Object (Excel): Stab Me !!!

Example:

  1. Modify the cell color:
    Use the cell's Interior class! The Color attribute can be changed or the background Color of the cell is displayed! ColorIndex uses numbers to modify the background color of cells!
    For I = 2 To 19 For j = 2 To 19 If Cells (I, j) = "A" Then Cells (I, j ). select Selection. interior. color = RGB (255,255, 0) 'by selecting and changing End If Cells (I, j) = "C" Then Cells (I, j ). interior. color = RGB (255, 0,255) 'directly uses Cells to modify End If Cells (I, j) = "D" Then Cells (I, j ). select Selection. interior. colorIndex = 2' use the index to modify End If NextNext

    VB, VBA, and VB. NET are similar, but they are different classes!
    Reference: Excel VBA Interior. ColorIndex color list
    Reference: Interior Object Members

  2. TBD

 

 

 

 

 

 

 

 

 

 

 

 

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.