当前位置:网站首页>Range.CopyFromRecordset 方法 (Excel)
Range.CopyFromRecordset 方法 (Excel)
2022-07-30 18:50:00 【OOQ】
将 ADO 或 DAO Recordset 对象的内容复制到工作表中(从指定区域的左上角开始)。 如果 Recordset 对象包含具有 OLE 对象的字段,则该方法无效。
语法
expression.CopyFromRecordset (Data, MaxRows, MaxColumns)
expression 一个表示 Range 对象的变量。
| 名称 | 必需/可选 | 数据类型 | 说明 |
|---|---|---|---|
| Data | 必需 | Variant | 复制到范围中的 Recordset 对象。 |
| MaxRows | 可选 | Variant | 复制到工作表中的记录数上限。 如果此参数被省略,便会复制 Recordset 对象中的所有记录。 |
| MaxColumns | 可选 | Variant | 复制到工作表中的字段数上限。 如果此参数被省略,便会复制 Recordset 对象中的所有字段。 |
For iCols = 0 to rs.Fields.Count - 1
ws.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
Next
ws.Range(ws.Cells(1, 1), _
ws.Cells(1, rs.Fields.Count)).Font.Bold = True
ws.Range("A2").CopyFromRecordset rs边栏推荐
- 常见链表题及其 Go 实现
- - daily a LeetCode 】 【 191. A number of 1
- 线性筛求积性函数
- MongoDB打破了原则引入SQL?
- 实体中增加操作方法
- 432.4 FPS 快STDC 2.84倍 | LPS-Net 结合内存、FLOPs、CUDA实现超快语义分割模型
- 基于inquirer封装一个控制台文件选择器
- [Prometheus] An optimization record of the Prometheus federation [continued]
- 基于b/s架构搭建一个支持多路摄像头的实时处理系统 ---- 使用yolo v5 系列模型
- 你好,我的新名字叫“铜锁/Tongsuo”
猜你喜欢
随机推荐
432.4 FPS 快STDC 2.84倍 | LPS-Net 结合内存、FLOPs、CUDA实现超快语义分割模型
中集世联达飞瞳全球工业人工智能AI领军者,全球顶尖AI核心技术高泛化性高鲁棒性稀疏样本持续学习,工业级高性能成熟AI产品规模应用
nlohmann json 使用指南【visual studio 2022】
OneFlow源码解析:Op、Kernel与解释器
[OC study notes] attribute keyword
攻防世界web-Cat
LeetCode每日一题(1717. Maximum Score From Removing Substrings)
Recommended Books | Recommend 3 database books with rave reviews
"Ruffian Heng Embedded Bimonthly" Issue 59
6 yuan per catty, why do Japanese companies come to China to collect cigarette butts?
CCNA-子网划分(VLSM)
Does the satellite phone communicate directly with the satellite or through a ground station?
终端分屏工具Terminalx的使用
固定资产可视化智能管理系统
尊重客观事实
Basic use of scrapy
博纳影通过IPO注册:阿里腾讯是股东 受疫情冲击明显
ROS 节点初始化步骤、topic/service创建及使用
(2022杭电多校四)1001-Link with Bracket Sequence II(区间动态规划)
解决终极bug,项目最终能顺利部署上线。








