ko6TjX2H.rar (7.16 KB, 下载次数: 49) 2010-11-29 16:42 上传 点击文件名下载附件 像笛卡尔乘积一样的循环要怎么写 谢谢各位老师的帮助[em23] 最佳答案 月排行榜 / 总排行榜 爱疯 2010-11-29 17:22 Sub a() Dim i, j For i = 1 To 5 For j = 1 To 5 If Cells(i, 1) = Cells(j, 4) Then Cells(i, 1).Font.ColorIndex = 3 End If Next j Next iEnd Sub只是这样比较吗 [em09] 跳转到最佳答案楼层
谢谢各位老师的帮助[em23]
Sub a() Dim i, j
For i = 1 To 5 For j = 1 To 5 If Cells(i, 1) = Cells(j, 4) Then Cells(i, 1).Font.ColorIndex = 3 End If Next j Next iEnd Sub
只是这样比较吗
使用道具 举报
a列的每个数字都要和d列的全部数字比较
比较后尼,干嘛?
Sub a() Dim i, j, arr arr = Range("d1:d" & Range("d65536").End(xlUp).Row) For i = 1 To 5 For j = 1 To UBound(arr) If Cells(i, 1) = arr(j, 1) Then Cells(i, 1).Font.ColorIndex = 3 End If Next j Next iEnd Sub
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )
GMT+8, 2024-3-29 17:58 , Processed in 0.531818 second(s), 10 queries , Gzip On, Yac On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.