
Sub Macro0402()
Dim bDay As Date, cAge As Integer
bDay = Range(“B3”).Value
cAge = Year(Now – bDay) – 1900
MsgBox “あなたの生年月日は” & bDay & “。現在は” & cAge & “歳です。”
End Sub
range プロパティでその値を得る

Just another WordPress site

Sub Macro0402()
Dim bDay As Date, cAge As Integer
bDay = Range(“B3”).Value
cAge = Year(Now – bDay) – 1900
MsgBox “あなたの生年月日は” & bDay & “。現在は” & cAge & “歳です。”
End Sub
range プロパティでその値を得る