excel range引用基础
时间:2023-11-30 02:36:34
currentregion当前区域指定。主要讲解excel单元格区域的另外一个属性currentregion,同时讲解一下currentregion熟悉与第15节内容的相关区别。
1、Range.CurrentRegion 介绍
Range.CurrentRegion 属性,返回一个 Range 对象,该对象表示当前区域。
代码如下:单元格选择
Sub 当前区域()
[a1].CurrentRegion.Select,以A1单元格对周边区域进行选择。
[f8].CurrentRegion.Select,以F8单元格对周边区域进行选择。
End Sub
2、案例介绍:currentregion运用对单元格进行求和。
代码如下:
Sub currentregion应用()
Rows(8).Clear ‘ 清除第8行数据
a = [b2].CurrentRegion.Address ’ 选择B2单元格周边区域
b = [b5].CurrentRegion.Address ’选择B5单元格周边区域
c = [b2].CurrentRegion.Count + 1 ’对B2单元格选择区域计算并+1
Set c = Range("b8", Cells(8, c)) ‘设置RANG范围对象,
c.FormulaArray = "=" & a & "+" & b ’ 设置数组格式对对应的单元格区域进行求和。
End Sub
3、usedrange与currentregion 区别
'如果表中只有一个区域,两者最后的结果是一样的,只是表达方式不一样。
代码如下:
Sub u与c()
Sheet3.UsedRange.Select
[a1].CurrentRegion.Select
End Sub
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10自带的卸载程序怎么打开?Win10在哪里卸载东西?
![](https://img.aspxhome.com/file/2023/0/52640_0s.jpg)
如何统计唯一的日期或时间?
![](https://img.aspxhome.com/file/2023/9/a142319_0s.png)
excel函数获取与查找值相对应的多个值
![](https://img.aspxhome.com/file/2023/8/a142478_0s.jpg)
Excel2010表格数据透视表改进和新增功能讲解
![](https://img.aspxhome.com/file/2023/3/a141673_0s.png)
excel如何新建样式
![](https://img.aspxhome.com/file/2023/4/a140524_0s.png)
在word中语法错误或拼写错误怎么标记?
如何清除 iOS 设备上 Safari 浏览器的「阅读列表」?
![](https://img.aspxhome.com/file/2023/3/46103_0s.jpg)
excel中取消隐藏教程
3个Word撰写毕业论文排版小技巧
![](https://img.aspxhome.com/file/2023/9/20839_0s.jpg)
word2013怎样设置纸张大小
![](https://img.aspxhome.com/file/2023/9/17919_0s.jpg)
Word2007:文档插入或删除水印的设置
![](https://img.aspxhome.com/file/2023/3/25203_0s.jpg)
使用规划求解求出最优生长曲线
word 利用模板新建文档的方法
![](https://img.aspxhome.com/file/2023/1/32961_0s.jpg)
excel如何计算相差日期天数
在Word中使用域帮助输入数学公式
![](https://img.aspxhome.com/file/2023/1/30401_0s.jpg)
excel中如何自定义函数
Excel图表制作方法介绍
word中怎么插入另外一个word文档
![](https://img.aspxhome.com/file/2023/3/34333_0s.png)
Word如何实现横竖混排效果?
![](https://img.aspxhome.com/file/2023/4/23914_0s.jpg)
用word制作一张课程表
![](https://img.aspxhome.com/file/2023/0/26110_0s.jpg)