||
Sub test() ' 除去Individual
Dim i, j As Long
For i = 1 To ActiveCell.Row
For j = 1 To 18
If InStr(Cells(i, j), "Individual") > 0 Then
Cells(i, j).ClearContents
End If
Next j
Next i
End Sub
Sub delp() '去重
Dim i As Long
For i = 1 To 615 '改动行数
If InStr(Cells(i, 3), " ") > 0 Then
Cells(i, 3).Replace " ", ""
End If
If InStr(Cells(i, 5), " ") > 0 Then
Cells(i, 5).Replace " ", ""
End If
If (InStr(Cells(i, 2), "-C") And InStr(Cells(i, 4), "-C")) > 0 Then
If Cells(i, 2) = Cells(i, 4) Then
Cells(i, 3).ClearContents
Cells(i, 4).ClearContents
End If
ElseIf Cells(i, 1) = Cells(i, 3) Then
Cells(i, 3).ClearContents
Cells(i, 4).ClearContents
End If
If InStr(Cells(i, 4), "-C") And InStr(Cells(i, 6), "-C") > 0 Then
If Cells(i, 4) = Cells(i, 6) Then
Cells(i, 5).ClearContents
Cells(i, 6).ClearContents
End If
ElseIf Cells(i, 3) = Cells(i, 5) Then
Cells(i, 5).ClearContents
Cells(i, 6).ClearContents
End If
If InStr(Cells(i, 2), "-C") And InStr(Cells(i, 6), "-C") > 0 Then
If Cells(i, 2) = Cells(i, 6) Then
Cells(i, 5).ClearContents
Cells(i, 6).ClearContents
End If
ElseIf Cells(i, 1) = Cells(i, 5) Then
Cells(i, 5).ClearContents
Cells(i, 6).ClearContents
End If
Cells(i, 7) = "check"
Next i
End Sub
Sub clear() '去掉前面的双空格
[a:a].Replace " ", ""
End Sub
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 21:34
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社