Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 3029|回复: 4

[已解决]填充颜色

[复制链接]
发表于 2014-10-15 21:39 | 显示全部楼层 |阅读模式
本帖最后由 left369 于 2014-10-16 09:46 编辑

填充颜色
最佳答案
2014-10-15 21:50
  1. Sub a()
  2. Dim i&, j&
  3. For i = 16 To Cells(Rows.Count, 2).End(3).Row
  4.     For j = 2 To Cells(16, Columns.Count).End(xlToLeft).Column
  5.         If Cells(i, j) Mod 2 = 0 Then
  6.            Cells(i, j).Interior.ColorIndex = 3
  7.         End If
  8.     Next
  9. Next
  10.    
  11. End Sub
复制代码

红色.zip

2.24 KB, 下载次数: 5

excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2014-10-15 21:49 | 显示全部楼层
红色.rar (4.07 KB, 下载次数: 4)
回复

使用道具 举报

发表于 2014-10-15 21:49 | 显示全部楼层
供参考

红色.zip

9.48 KB, 下载次数: 11

回复

使用道具 举报

发表于 2014-10-15 21:50 | 显示全部楼层    本楼为最佳答案   
  1. Sub a()
  2. Dim i&, j&
  3. For i = 16 To Cells(Rows.Count, 2).End(3).Row
  4.     For j = 2 To Cells(16, Columns.Count).End(xlToLeft).Column
  5.         If Cells(i, j) Mod 2 = 0 Then
  6.            Cells(i, j).Interior.ColorIndex = 3
  7.         End If
  8.     Next
  9. Next
  10.    
  11. End Sub
复制代码
回复

使用道具 举报

发表于 2014-10-15 22:56 | 显示全部楼层
还是用条件格式方便
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-17 05:59 , Processed in 0.144234 second(s), 11 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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