excel宏动态秒
Roger Govier has taken the pain out of creating dynamic ranges, by creating a macro to automatically create the ranges for you.
Roger Govier通过创建一个宏来自动为您创建范围,从而减轻了创建动态范围的麻烦。
When you run the macro in Excel, it creates a series of names for each of the column headings on the sheet. In addition to the Names for the column ranges, 3 extra names are defined:
当您在Excel中运行宏时,它将为工作表上的每个列标题创建一系列名称。 除了列范围的名称外,还定义了3个额外的名称:
lrow for the last row number used on the sheet
lrow用于在片材上使用的最后一个行号
lcol for the last column number used on the sheet
lcol为工作表上使用的最后一列号
myData for the complete range of Data including the Header row.
myData表示整个数据范围,包括标题行。
Roger uses the INDEX function in the names, instead of OFFSET, which is volatile, and could slow down your workbook.
Roger在名称中使用INDEX函数,而不是OFFSET,这是易失的,可能会减慢您的工作簿。
![image005 image005](https://i-blog.csdnimg.cn/blog_migrate/72d6b591613dd22a0ede0528a45812a9.png)
To see the code, and read a description of Roger's technique, you can visit the Create Dynamic Ranges With a Macro page.
要查看代码并阅读Roger的技术说明,可以访问“ 使用宏创建动态范围”页面。
You can download the zipped sample file there, to see how Roger's technique works. ___________________
您可以在此处下载压缩后的样本文件,以了解Roger的技术如何工作。 ___________________
翻译自: https://contexturesblog.com/archives/2009/02/23/creating-dynamic-ranges-in-excel-with-a-macro/
excel宏动态秒