Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
楼主: 兰色幻想

[习题] 【v1-6综合练习题1】如何按条件填充颜色

[复制链接]
发表于 2008-2-4 15:23 | 显示全部楼层

<p>Sub aa()<br/>Dim a As Long<br/>Dim b As Long<br/>For a = 1 To 9<br/>&nbsp;For b = 1 To 3<br/>&nbsp; If Cells(a, b) &gt; 100 Then<br/>&nbsp; Cells(a, b).Select<br/>&nbsp; Selection.Interior.ColorIndex = 7 '粉红色<br/>&nbsp; End If<br/>&nbsp;Next b<br/>Next a</p><p>Dim c As Long<br/>Dim d As Long<br/>For c = 10 To 21<br/>&nbsp;For d = 4 To 6<br/>&nbsp; If Cells(c, d) &gt; 100 Then<br/>&nbsp; Cells(c, d).Select<br/>&nbsp; Selection.Interior.ColorIndex = 5 '蓝色<br/>&nbsp; End If<br/>&nbsp;Next d<br/>Next c<br/>End Sub<br/></p><p>写的有点啰嗦</p>
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-6-29 05:32 , Processed in 0.091145 second(s), 3 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表