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

推荐订阅源

Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
B
Blog RSS Feed
G
GRAHAM CLULEY
Microsoft Azure Blog
Microsoft Azure Blog
Know Your Adversary
Know Your Adversary
N
Netflix TechBlog - Medium
A
Arctic Wolf
W
WeLiveSecurity
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Blog of Author Tim Ferriss
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
T
Threatpost
博客园 - 叶小钗
G
Google Developers Blog
U
Unit 42
Latest news
Latest news
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
Hacker News: Ask HN
Hacker News: Ask HN
MongoDB | Blog
MongoDB | Blog
H
Hacker News: Front Page
F
Fortinet All Blogs
T
Tailwind CSS Blog
The Register - Security
The Register - Security
Apple Machine Learning Research
Apple Machine Learning Research
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Heimdal Security Blog
A
About on SuperTechFans
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
Application and Cybersecurity Blog
Application and Cybersecurity Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Schneier on Security
Schneier on Security
Y
Y Combinator Blog
V
Visual Studio Blog
GbyAI
GbyAI
Forbes - Security
Forbes - Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
N
News | PayPal Newsroom
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs

博客园 - 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 方法