以下のコードを使用していますが、次のステートメントが機能しません。
If UCase(Left(Dn, 2)) = "LM" Then
Dn.Offset(, 1) = Val(Mid(Dn, 2, 3)) + 3.5
コードは上記のステートメントから何も実行しません。
Case "L"
**If UCase(Left(Dn, 2)) = "LM" Then
If IsNumeric(Mid(Dn, 2, 1)) And IsNumeric(Mid(Dn, 3, 1)) Then
If Mid(Dn, 3, 1) = "0" Then
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 3.5
Else
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 0.35
End If
End If
ElseIf IsNumeric(Mid(Dn, 4, 1)) And IsNumeric(Mid(Dn, 5, 1)) Then
If Mid(Dn, 5, 1) = "0" And Mid(Dn, 4, 1) = "0" Then
If Dn.Offset(, 3) = "CMBS" Then
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 20
Else
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 2
End If
ElseIf UCase(Left(Dn, 6)) Like "LM###S" Then
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 2
Else
Dn.Offset(, 1) = Mid(Dn, 3, 3) + 0.2
End If**
ElseIf UCase(Left(Dn, 3)) = "L/M" Then
Dn.Offset(, 1) = Val(Mid(Dn, 4, 2)) + 3.5
ElseIf UCase(Left(Dn, 3)) = "LM$" Then
Dn.Offset(, 1) = Val(Mid(Dn, 4, 2)) + 3.5
ElseIf UCase(Left(Dn, 2)) = "L$" Then
Dn.Offset(, 1) = Val(Mid(Dn, 3, 2)) + 2
ElseIf UCase(Left(Dn, 3)) = "LO-" Then
Dn.Offset(, 1) = Val(Mid(Dn, 4, 2)) + 2
ElseIf UCase(Left(Dn, 6)) = "LO MID" Then
Dn.Offset(, 1) = Val(Mid(Dn, 7, 3)) + 3.5
ElseIf UCase(Left(Dn, 3)) = "LO " Then
Dn.Offset(, 1) = Val(Mid(Dn, 4, 2)) + 2
ElseIf UCase(Left(Dn, 5)) Like "L###H" Then
Dn.Offset(, 1) = Val(Mid(Dn, 2, 3)) + 0.2
ElseIf UCase(Left(Dn, 4)) Like "L##H" Then
Dn.Offset(, 1) = Val(Mid(Dn, 2, 2)) + 0.2
ElseIf UCase(Left(Dn, 4)) Like "L#" Then
Dn.Offset(, 1) = Val(Mid(Dn, 2, 2)) + 0.2
ElseIf IsNumeric(Mid(Dn, 3, 1)) And IsNumeric(Mid(Dn, 4, 1)) Then
If Mid(Dn, 4, 1) = "0" And Mid(Dn, 3, 1) = "0" Then
If Dn.Offset(, 3) = "CMBS" Then
Dn.Offset(, 1) = Mid(Dn, 2, 3) + 20
Else
Dn.Offset(, 1) = Mid(Dn, 2, 3) + 2
End If
ElseIf UCase(Left(Dn, 5)) Like "L###S" Then
Dn.Offset(, 1) = Mid(Dn, 2, 3) + 2
Else
Dn.Offset(, 1) = Mid(Dn, 2, 3) + 0.2
End If
ElseIf IsNumeric(Mid(Dn, 3, 1)) And IsNumeric(Mid(Dn, 4, 1)) Then
If Mid(Dn, 4, 1) = "0" And Mid(Dn, 3, 1) <> "0" Then
Dn.Offset(, 1) = Mid(Dn, 2, 3) + 0.2
End If
ElseIf UCase(Left(Dn, 3)) Like "L##" Then
If IsNumeric(Mid(Dn, 2, 1)) Then
If Mid(Dn, 3, 1) = "0" Then
Dn.Offset(, 1) = Mid(Dn, 2, 2) + 2
Else
Dn.Offset(, 1) = Mid(Dn, 2, 2) + 0.2
End If
End If
End If
入力値 -->
lm10、LM120S、LM120 所望の出力 -->
13.5 123.5 120.35
この問題に関するヘルプをいただければ幸いです。