在VFP程序中怎样设置Excel的条件格式?

ssq0001 2012-08-25 10:22:34
用VFP生成的Excel在程序中怎样才能设置条件格式?
下图是直接在Excel中设置的条件格式:

在VFP程序中用下面方法设置Excel的条件格式第4、6行总会出错:
Range('D4').Select && 1
Application.CutCopyMode=.F. && 2
Selection.FormatConditions.Delete && 3
Selection.FormatConditions.Add(2,'=D4<60') && 4
Selection.FormatConditions(1).Font.ColorIndex=3 && 5
Selection.FormatConditions.Add(2,'=D4>90') && 6
Selection.FormatConditions(2).Font.Bold=.T. && 7
Selection.FormatConditions(2).Font.Italic=.F. && 8
Selection.FormatConditions(2).Font.ColorIndex=5 && 9
Selection.FormatConditions(2).Interior.ColorIndex=34 && 10
请高手指点
...全文
317 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
十豆三 2012-08-25
  • 打赏
  • 举报
回复 1
try:
Selection.FormatConditions.Add(2,,'=D4<60') && 4
Selection.FormatConditions.Add(2,,'=D4>90') && 6

2,749

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧