- 帖子
- 19
- 主題
- 1
- 精華
- 0
- 積分
- 50
- 點名
- 0
- 作業系統
- windows7
- 軟體版本
- Office2007
- 閱讀權限
- 20
- 註冊時間
- 2011-10-10
- 最後登錄
- 2023-12-14
|
可否請各位先進幫我簡化代碼
可以請各位先進幫小弟簡化代碼,讓他執行快一點,到後面50幾行就很慢了,謝謝各位...
Private Sub jump123()
For a = 2 To 10000
If Cells(a, 1) = "" Then Exit For
s = Cells(a, 4)
If s Like "201106*" Then
Cells(a, 5) = "A"
End If
If s Like "201101*" Then
Cells(a, 5) = "B"
End If
If s Like "201111*" Then
Cells(a, 5) = "C"
End If
If s Like "201102*" Then
Cells(a, 5) = "D"
End If
If s Like "201127*" Then
Cells(a, 5) = "E"
End If
If s Like "1101*" Then
Cells(a, 5) = "F"
End If
If s Like "1102*" Then
Cells(a, 5) = "G"
End If
If s Like "1103*" Then
Cells(a, 5) = "H"
End If
If s Like "1104*" Then
Cells(a, 5) = "I"
End If
If s Like "1105*" Then
Cells(a, 5) = "J"
End If
If s Like "1106*" Then
Cells(a, 5) = "K"
End If
If s Like "1107*" Then
Cells(a, 5) = "L"
End If
If s Like "1108*" Then
Cells(a, 5) = "M"
End If
If s Like "1109*" Then
Cells(a, 5) = "N"
End If
If s Like "1110*" Then
Cells(a, 5) = "O"
End If
If s Like "1111*" Then
Cells(a, 5) = "P"
End If
If s Like "1112*" Then
Cells(a, 5) = "Q"
End If
If s Like "1113*" Then
Cells(a, 5) = "R"
End If
If s Like "1114*" Then
Cells(a, 5) = "S"
End If
If s Like "1115*" Then
Cells(a, 5) = "T"
End If
If s Like "1116*" Then
Cells(a, 5) = "U"
End If
If s Like "1117*" Then
Cells(a, 5) = "V"
End If
If s Like "1118*" Then
Cells(a, 5) = "X"
End If
If s Like "1119*" Then
Cells(a, 5) = "Y"
End If
If s Like "1120*" Then
Cells(a, 5) = "Z"
End If
Next a
End Sub |
|