The letters in VBA Excel that represent columns are replaced by numbers

Source: Internet
Author: User

From here

Number-to-column label: Split (Cells (1,1). Address (1,0), "$") (0) ' Replace 1-256 with red 1 to

Cells (1, a) Select a cell in column A of the corresponding first row;

The return value of address is the absolute address of the cell, such as $A$1, A column 1 row;

It has 4 parameters, let's get straight to the front two, the first is the absolute path of the line, the default is true, the second is the absolute path of the column defaults to False

A:cells (1, 1). Address () "$A $"

B:cells (1, 1). Address (1, 0) "A$"

C:cells (1, 1). Address (0, 1) "$A1"

Split, "$" for [A, 1] (0) is a.

The column-to-number is simpler: Range ("IV" & 1). Column ' Replace the label letter A-iv with the Red IV to

IV1 number of columns in cell ....

The letters in VBA Excel that represent columns are replaced by numbers

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.