- 1、本文档共17页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
VBA入门的基础语句-详解(国外英文资料)
VBA入门的基础语句-详解(国外英文资料)
The basic statement of the VBA entry - detailed solution
Select a worksheet:
( Balance ). Activate.
Select cells:
Range ( A1 ). The Select
Select a contiguous cell:
Range ( A1: G8 ). Select
Select a discontinuous cell:
Range ( A1, B6, D9 ).select
Range ( A1, B6: B10, D9 ).select
Select the working book for the current activity:
ThisWorkbook. Activate
If you choose another workbook, note that the workbook must be open, and dont forget to add the suffix .xls for example:
Windows ( Totol. XLS )
Select a worksheet:
( Balance ). Activate.
Cell move:
ActiveCell. Offset (13, 14). Select
Offset (-3, -4). Select
Range ( G8 ). Offset (-3, -4). Select
Note: you can define a variable and implement it with an offset, for example:
VarFreightRowsCount = Range ( A1 ).currentregion. Rows. Count
(varFreightRowsCount, 0).select
Select the entire worksheet:
Cells. The Select
Select the area where the current cell is located (in the case of a null row/empty column) :
Range ( A1 ).currentregion. Select content comes from the vba technical federation
Select rows or columns:
Rows ( 1 ). The Select
The Columns ( A ). The Select
Or:
ActiveCell. EntireRow. Select
ActiveCell. EntireColumn. Select
Select contiguous rows/columns:
Columns ( A: C ). Select
Rows ( 1:5 ).select
Choose not contiguous rows/columns:
Note: use Range instead of Columns/Rows instead of Columns/Rows : you are using Range instead of Columns/Rows.
The Range ( A: A, C: C, E: F ).select
Range ( 1:1, 5:6, 9:9 ).select
Select the current active cell to the last non-empty cell:
The Range ( A1 , Range ( A1 ).end (xlDown))
Range (ActiveCell, ActiveCell.end (xlDown)).select
Select the current active cell to the first non-empty cell:
Range ( A32 , Range ( A32 ).end (xlUp).select
Range (ActiveCell, ActiveCell.end (xlUp)).select
Select the current active cell to the right to the first non-empty cell.
Note: xlTORight instead of xlRight
The Range ( A1 , Range ( A1 ).end (xltoRight).select
Range (ActiveCell, ActiveCe
文档评论(0)