Excel精英培训网

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

运行后效果为什么不一样?

[复制链接]
发表于 2016-3-3 17:17 | 显示全部楼层 |阅读模式
为什么将代码中的红色背景字简化成绿色背景字,运行后效果为什么不一样?
If InStr(k & a & b & d & a & c & d & a & d, s) > 0 Then
Sub 同列四链法2()
    For j = 1 To 9
        For k = 1234 To 6789
            a = Left(k, 1)
            b = Mid(k, 2, 1)
            c = Mid(k, 3, 1)
            d = Right(k, 1)
            If d > c And c > b And b > a Then
                For i = 1 To 9
                    s = CStr(Cells(i, j))
                   If s = a & b Or s = a & c Or s = a & d Or s = b & c Or s = b & d Or s = c & d _
                       Or s = a & b & c Or s = a & b & d Or s = a & c & d Or s = b & c & d _
                       Or s = a & b & c & d Then
                        n = n + 1
                        x = x & "," & Cells(i, j).Address
                    Else
                        y = y & "," & Cells(i, j).Address
                    End If
                Next
            End If
            If n = 4 Then
                Range(Mid(x, 2)).Font.Size = 36
                yy = Mid(y, 2)
                Range(yy).Replace a, ""
                Range(yy).Replace b, ""
                Range(yy).Replace c, ""
                Range(yy).Replace d, ""
            End If
            n = 0: x = "": y = ""
        Next
    Next
End Sub

月光曲.zip

17.32 KB, 下载次数: 1

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

本版积分规则

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

GMT+8, 2024-4-23 17:54 , Processed in 0.130977 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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