|
本帖最后由 lingyuncelia1 于 2016-3-13 15:48 编辑
Sub 同行隐含三链数法()
a = 5
b = 6
c = 7
For j = 1 To 9
s = CStr(Cells(1, j))
If s Like "*" & a & "*" & b & "*" Or s Like "*" & a & "*" & c & "*" _
Or s Like "*" & b & "*" & c & "*" Or s Like "*" & a & "*" & b & "*" & c & "*" Then
n = n + 1
x = x & "," & Cells(1, j).Address
End If
Next
If n = 3 Then
For j = 1 To 9
s = CStr(Cells(1, j))
If Not s Like "*" & a & "*" & b & "*" And Not s Like "*" & a & "*" & c & "*" _
And Not s Like "*" & b & "*" & c & "*" And Not s Like "*" & a & "*" & b & "*" & c & "*" Then
y = y & "," & Cells(1, j).Address
yy = Mid(y, 2)
End If
Next
For j = 1 To 9
If Not Range(yy).Text Like "*" & a & "*" _ ‘Range(yy) 是指B1\D1\E1\F1\G1\I1
And Not Range(yy).Text Like "*" & b & "*" _
And Not Range(yy).Text Like "*" & c & "*" Then
Range(Mid(x, 2)).Font.Size = 36 ’Range(Mid(x, 2))是指A1\C1\H1
End If
Next
End If
n = 0: x = "": y = ""
End Sub
是不是想表达这个意思? - Sub 同行隐含三链数法()
- a = 5
- b = 6
- c = 7
- For j = 1 To 9
- s = CStr(Cells(1, j))
- If s Like "*" & a & "*" & b & "*" Or s Like "*" & a & "*" & c & "*" _
- Or s Like "*" & b & "*" & c & "*" Or s Like "*" & a & "*" & b & "*" & c & "*" Then
- n = n + 1
- x = x & "," & Cells(1, j).Address
- Else
- y = y & Cells(1, j)
- End If
- Next
-
- If n = 3 Then
- If Not y Like "*" & a & "*" And Not y Like "*" & b & "*" _
- And Not y Like "*" & c & "*" Then
- Range(Mid(x, 2)).Font.Size = 36
- End If
- End If
- n = 0: x = "": y = ""
- End Sub
复制代码
|
|