- Sub test()
- Dim LrowNo As Integer, i As Integer, S1 As Integer, S2 As Integer, S3 As Integer, a As Integer
- LrowNo = Range("B65536").End(xlUp).Row
- For i = 3 To LrowNo
- a = 12
- S1 = Val(Left(Cells(i, 2), 1)) + Val(Mid(Cells(i, 2), 2, 1))
- S2 = Val(Left(Cells(i, 2), 1)) + Val(Right(Cells(i, 2), 1))
- S3 = Val(Right(Cells(i, 2), 1)) + Val(Mid(Cells(i, 2), 2, 1))
- If S1 Mod 2 = 0 Then
- Cells(i, a) = Right(S1, 1)
- a = a + 1
- End If
- If S2 Mod 2 = 0 Then
- Cells(i, a) = Right(S2, 1)
- a = a + 1
- End If
- If S3 Mod 2 = 0 Then
- Cells(i, a) = Right(S3, 1)
- End If
- Next i
- End Sub
复制代码 |