Option Explicit
'▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼
Sub main()
'--- --- --- --- --- --- --- --- --- ---
'□ 最終行の取得
'--- --- --- --- --- --- --- --- --- ---
Dim Last_Row As Long '最終行数用変数
Last_Row = 0 '最終行数の変数をゼロクリア
Last_Row = Cells(1, "B").End(xlDown).Row '最終行の数を取得
'--- --- --- --- --- --- --- --- --- ---
'--- --- --- --- --- --- --- --- --- ---
'□ 日付の表示変更(シリアル値 ⇒ m/d形式)
'--- --- --- --- --- --- --- --- --- ---
Dim Row_i As Long 'ループカウント用
Dim A_Value As Variant 'セルの値を格納
For Row_i = 2 To Last_Row
A_Value = Cells(Row_i, "B").Value
MsgBox A_Value
'# 文字の長さ判定
If Len(A_Value) < 7 Then
'# 処理なし
Else
A_Value = Format(A_Value, "m/d")
A_Value = A_Value & "."
End If
'# 文字の長さ判定
If Len(A_Value) >= 8 Then
A_Value = Mid(A_Value, 6)
End If
MsgBox A_Value
Cells(Row_i, "B") = A_Value
Next
'--- --- --- --- --- --- --- --- --- ---
End Sub
'▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼
PR
COMMENT