|
为什么将代码中的红色背景字简化成绿色背景字,运行后效果为什么不一样?
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
|
|