Excel2007新知.docxVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Excel2007新知:在VBA中使用条件格式的示例译者:Kevin? 来源:/excel/excel 发表于:2006年7月7日Since I have had some comments and emails asking about how the new conditional formatting features could be accessed using VBA, I wanted to provide a few brief examples. One of the Excel team’s principles is that when we add new features, we make sure that they are available programmatically as well as in the user interface. The Excel 12 object model, accordingly, supports all conditional formatting functionality that is supported in the UI. This includes creating, editing, or deleting rules, or changing priorities on rules.自从我收到一些关于“如何在VBA中使用新的条件格式”的询问,我就想提供给大家一些简单的示例。在我们Excel开发团队中有一条法则:当我们增加任何新功能时,我们必须确定它们在被程序调用时能和在用户界面中工作的一样好。Excel 12的对象模型支持所有出现在用户界面中的条件格式功能,包括增加、编辑和s删除规则,或者更改规则的优先级。As folks who have written conditional formatting VBA in previous versions of Excel will know, the FormatConditions collection hangs off the Range object. Let me briefly run through some examples of how our new functionality is exposed in the FormatConditions collection.在旧版本Excel中写过与条件格式相关的VBA代码的人会知道,条件格式集不能使用Range对象。让我通过运行一些简单示例来展示如何使用条件格式集中的新功能。Creating a rule: The new conditional formatting rules we have introduced in Excel 12 (Databars, Color Scales, Icon Sets, Top n, etc.) can be created using the Addobjectname method in the FormatConditions collection. For example, to add a Databar, run:Range(A1:A5).FormatConditions.AddDatabar增加一个规则:Excel 12中,新的条件格式的规则(Data bars, Color Scales, Icon Sets, Top n等待),可以在条件格式集中使用Add 对象名的方法来创建。比如,创建一个data bar:Range(A1:A5).FormatConditions.AddDatabarEditing the rule:To edit the rule, index into the FormatConditions collection and modify the properties. For example, to change the bar color, run:Range(A1:A5).FormatConditions(1).BarColor.ColorIndex = 3Here, the number 1 indexes the first rule on the range.编辑现有规则:编辑规则是通过定位条件格式集的索引号并修改其属性。比如,更改data bar的颜色:Range(A1:A5).FormatConditions(1).BarColor.ColorIndex = 3在这里,数字1表示区域中的第一个规则。Editing the priority:In Excel 12, we introduced the idea of rule p

文档评论(0)

神话 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

版权声明书
用户编号:5203223011000000

1亿VIP精品文档

相关文档