excel FormulaR1C1语法及使用方法
时间:2022-04-08 00:34:18
①FormulaR1C1属性的功能
返回或设置指定对象的公式,使用宏语言 R1C1 格式符号表示。Variant 型,可读写。
②FormulaR1C1的语法
表达式.FormulaR1C1
表达式 一个代表 Range 对象的变量。
语法说明
如果单元格包含一个常量,此属性返回该常量。如果单元格为空,此属性返回一个空字符串。如果单元格包含公式,此属性将该公式作为字符串返回,所用格式与在编辑栏(包括等号)中显示时的格式相同。
如果将单元格的格式的值或公式设为日期类型,Microsoft Excel 将检查该单元格的格式是否符合某个日期或时间数组格式,如果不符合,将采用默认的短日期数字格式。
如果指定区域是一维或二维区域,则可将公式指定为 Visual Basic 中相同维数的数组。同样,也可在 Visual Basic 数组中使用公式。
对多重单元格区域设置公式,则该区域中所有单元格都用此公式填充。
③FormulaR1C1的简单例子
例子一:
Worksheets("Sheet1").Range("B1").FormulaR1C1 = "=SQRT(R1C1)"
作用是:给Sheet1工作表的B1单元格设置公式,所设置的公式为:"=SQRT(C2)
例子二:
Worksheets(1).Cells(3, 4).FormulaR1C1 = "=Average(RC[-3]:RC[-2])"
作用是,给编号为1的工作表中的D3单元格设置公式,所设置的公式为: =Average(A3:B3)
标签:excel,FormulaR1C1语法及使用方法
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
pdf怎么转成word文档
2023-07-02 09:53:43
word怎么设置上标下标? word批量添加上下标的技巧
2023-06-23 14:29:15
![](https://img.aspxhome.com/file/2023/7/30197_0s.jpg)
男子月薪9000元不会用word被辞退?公司回应来了
2023-11-09 23:13:48
![](https://img.aspxhome.com/file/2023/1/17071_0s.jpg)
word 如何为文本设置双行合一的排版效果?
2023-10-27 11:35:29
![](https://img.aspxhome.com/file/2023/4/35554_0s.png)
Win10键盘没有办法输入怎么办?
2023-11-18 01:39:48
![](https://img.aspxhome.com/file/2023/6/49726_0s.png)
word怎么排版成一页里左右对应
2023-12-06 15:10:01
win10比win7流畅么
2023-11-11 16:14:12
![](https://img.aspxhome.com/file/2023/0/48190_0s.jpg)
Word中选定单个单词的方法
2023-02-03 06:22:38
![](https://img.aspxhome.com/file/2023/2/33542_0s.jpg)
Win10记事本有什么作用?Win10记事本使用方法分享
2023-11-24 04:58:49
![](https://img.aspxhome.com/file/2023/2/50602_0s.jpg)
如何阻止电脑自动升级到Win10 21H1版本?
2023-11-23 16:42:35
![](https://img.aspxhome.com/file/2023/7/50737_0s.jpg)
word柱形图柱体的颜色怎么更改? word柱形图修改颜色的教程
2022-04-01 08:23:00
![](https://img.aspxhome.com/file/2023/6/30216_0s.png)
如何检测 AirPods/AirPods Pro 是否为正品?
2023-10-13 02:59:59
![](https://img.aspxhome.com/file/2023/7/a194617_0s.png)
Word文字环绕图片的方法
2023-08-31 05:09:33
Word如何使用审阅功能纠正文档错误
2023-11-29 15:41:17
![](https://img.aspxhome.com/file/2023/1/18291_0s.jpg)
千万不要小看Word!用好了,可以让你的工作效率翻番
2022-11-29 02:30:31
![](https://img.aspxhome.com/file/2023/6/24176_0s.png)
Word 2010去除图片背景小技巧
2023-02-22 10:07:28
![](https://img.aspxhome.com/file/2023/6/21366_0s.jpg)
word利用条形码控件制作条形码
2022-03-02 01:11:45
![](https://img.aspxhome.com/file/2023/7/23477_0s.jpg)
Win10蓝牙关闭之后就打不开了的解决方法
2023-11-13 09:40:44
![](https://img.aspxhome.com/file/2023/5/49145_0s.png)
如何给word文档中的文字添加拼音
2023-11-29 22:57:07
![](https://img.aspxhome.com/file/2023/9/18769_0s.png)
Word2010中调整行间距的方法
2023-12-07 00:14:29
![](https://img.aspxhome.com/file/2023/9/20169_0s.jpg)