惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
月光博客
月光博客
WordPress大学
WordPress大学
C
Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 【当耐特】
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
有赞技术团队
有赞技术团队
Microsoft Azure Blog
Microsoft Azure Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
小众软件
小众软件
H
Heimdal Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
W
WeLiveSecurity
量子位
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
NISL@THU
NISL@THU
Forbes - Security
Forbes - Security
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
L
LINUX DO - 热门话题
Google Online Security Blog
Google Online Security Blog
S
Security Affairs
V2EX - 技术
V2EX - 技术
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
宝玉的分享
宝玉的分享
Project Zero
Project Zero
The Hacker News
The Hacker News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
PCI Perspectives
PCI Perspectives
G
GRAHAM CLULEY
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
S
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 聂微东

博客园 - focus

IE浏览器自定义地址协议 -- 通过B/S程序中打开C/S程序 Html编辑器 -- TinyMCE HTML编辑器 -- HtmlArea 用 BindingSource 绑定窗体中控件不失去焦点无法更新数据源的问题 - focus asp.net 服务器控件防止重复提交表单 - focus - 博客园 html 元素的 onpropertychange 事件 动态创建大量 html dom 元素时提升性能 - focus 很黄的日期格式化。。。 - focus - 博客园 Asp.net 导出 .html,.txt 等格式的文件 ActiveReports 打印条码无法设置纸张大小? ActiveReports 代码控制报表连续打印 《JavaScript高级程序设计》读书笔记之一:几个与原始类型等价的引用类型的常用方法和属性 js:delete 操作符 js:for...in 语句(JavaScript For...In Statement) js:字符串类型快速转化成数字类型和数字类型快速转化为字符串类型 html 的 image button 自动提交 form Internet Explorer Developer Toolbar IE 最大化和最小化 js trim
c# 操作 Excel : 给单元格增加下拉选项值
focus · 2008-04-24 · via 博客园 - focus

Posted on 2008-04-24 19:55  focus  阅读(7232)  评论(8)    收藏  举报

在 Excel 中通过设置单元格的 数据->有效性->序列 的方式可以为单元格增加一个下拉框,而如何用代码来动态更改下拉框的可选值呢?或者用代码来给某个单元格增加一个下拉框?
以下是 C# 代码的实现:

worksheet.get_Range(worksheet.Cells[11], worksheet.Cells[11]).Validation.Modify(Excel.XlDVType.xlValidateList, Excel.XlDVAlertStyle.xlValidAlertStop, Type.Missing, "1,2,3", Type.Missing);//单元格已设置数据有效性,只能用代码修改有效性;如果单元格未设置有效性,需要使用 Add 方法