Excel learning notes-Area Selection

Source: Internet
Author: User

 

ExcelStudy Notes -Region selection

 

Preface

The New Year is approaching, and I will write down some of my recent learning content. This is a summary of the work and serves as a memorable souvenir. The New Year has a new atmosphere, and 2009 is destined to be a year full of challenges.

The Excel area selection function is very powerful, which brings a lot of flexibility to programming. This article will record some useful selection methods. In Excel, Range is an important object. It represents a combination of cells. Operations on the Range will affect all the cells it contains, which is much more convenient than one unit.

RangeSelect

Range ("A1") Select 1st rows and 1st Columns

Range ("A1: B5"): select the square area between A1 and B5.

Range ("A1: B5, C1: C10") Select multiple regions

Range ("A: A") or Range ("") Select column A (column 1st)

Range ("A: C") Select column A to column C

[A1: B5] This is a convenient recording method, which is equivalent to Range ("A1: B5 ").

 

RowsAnd Columns

Used to select rows and columns

Rows (1) first line

Rows select all Rows

Columns (1) or Columns ("A") 1st Columns

 

CellsUsed to select Cells

Cells (6, 1) contains 6th rows and 1st Cells. The Cell object is returned.

To convert a Cell object to a Range object, use [myCell].

 

UnionEach Range

Dim myRange as Range

Set myRange = Union (Rows (1), Range ("C: C "))

MyRange. Font. Bold = true

 

Relative displacement

Is relative to a Range.

MyRange. Offset (1, 3) Select cells in the right 3 columns of the row under myRange.

 

Obtain the cell value cyclically

For each myCell in Range ("A1: B5 ")

'...

Next myCell

 

 

 

 

 

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.