|
- Sub qs()
- Dim arr, i, ar, s
- With Sheet1
- arr = .Range("a2:e16")
- ar = .Range("a17:e31")
- For i = 1 To UBound(arr)
- s = arr(i, 2)
- If IsNumeric(Right(s, 1)) And InStr(s, "租赁") Then
- arr(i, 3) = "444444"
- ElseIf IsNumeric(Right(s, 1)) And InStr(s, "费") Then
- arr(i, 3) = "333333"
- ElseIf IsNumeric(Right(s, 1)) Then
- arr(i, 3) = "222222"
- Else
- arr(i, 3) = "111111"
- End If
- Next
- For i = 1 To UBound(ar)
- s = ar(i, 2)
- If IsNumeric(Right(s, 1)) And InStr(s, "租赁") Then
- ar(i, 3) = "999999"
- ElseIf IsNumeric(Right(s, 1)) And InStr(s, "费") Then
- ar(i, 3) = "888888"
- ElseIf IsNumeric(Right(s, 1)) Then
- ar(i, 3) = "777777"
- Else
- ar(i, 3) = "666666"
- End If
- Next
- .Range("i2").Resize(UBound(arr), UBound(arr, 2)) = arr
- .Range("i16").Resize(UBound(ar), UBound(ar, 2)) = ar
- End With
- End Sub
复制代码 |
|