Sub Sample()Dim r As Range
ForEach r In ActiveSheet.UsedRange
IfIsDate(r.Value)=TrueThen
r.Value=CDate("8/1")EndIfNextEndSub
shotomoさんのコメント
すみません。8月が限定ではないです。
shotomoさんのコメント
出来ました。ありがとうございました。
Sub test()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If IsDate(r.Value) = True Then
Dim m
m = Month(r)
p = m & "01"
Dim strMOTO As String
Dim 基準日 As Date
strMOTO = p
基準日 = CDate(Format(strMOTO, "@@/@@"))
r.Value = 基準日
End If
Next
End Sub
Mookさんのコメント
そうであれば、こんなのでも。
Sub test2()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If IsDate(r.Value) = True Then
r.Value = DateSerial(Year(r.Value), Month(r.Value), 1)
End If
Next
End Sub
shotomoさんのコメント
さすがです。すっきりですね。ありがとうございました。勉強します