回答編集履歴
2
誤記修正
answer
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
Cells(2, 3).Value = CDbl(Cells(2, 1).Value)
|
9
9
|
Cells(3, 2).Value = DateValue(Cells(3, 1).Value)
|
10
10
|
Cells(3, 2).NumberFormatLocal = "G/標準"
|
11
|
-
Cells(3, 3).Value = CDbl(Cells(
|
11
|
+
Cells(3, 3).Value = CDbl(Cells(3, 1).Value)
|
12
12
|
Cells(4, 2).Value = DateValue(Cells(4, 1).Value)
|
13
13
|
Cells(4, 2).NumberFormatLocal = "G/標準"
|
14
|
-
Cells(4, 3).Value = CDbl(Cells(
|
14
|
+
Cells(4, 3).Value = CDbl(Cells(4, 1).Value)
|
15
15
|
End Sub
|
16
16
|
```
|
1
CDbl関数を追記
answer
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
セルの表示形式を標準にしてみました。
|
2
|
+
<追記>
|
3
|
+
Excel関数とVBA関数は異なる場合があり、VBAでシリアル値へ変換する場合、CDbl関数を用います。
|
2
4
|
```VBA
|
3
5
|
Sub dateValue値2()
|
4
6
|
Cells(2, 2).Value = DateValue(Cells(2, 1).Value)
|
5
7
|
Cells(2, 2).NumberFormatLocal = "G/標準"
|
8
|
+
Cells(2, 3).Value = CDbl(Cells(2, 1).Value)
|
6
9
|
Cells(3, 2).Value = DateValue(Cells(3, 1).Value)
|
7
10
|
Cells(3, 2).NumberFormatLocal = "G/標準"
|
11
|
+
Cells(3, 3).Value = CDbl(Cells(2, 1).Value)
|
8
12
|
Cells(4, 2).Value = DateValue(Cells(4, 1).Value)
|
9
13
|
Cells(4, 2).NumberFormatLocal = "G/標準"
|
14
|
+
Cells(4, 3).Value = CDbl(Cells(2, 1).Value)
|
10
15
|
End Sub
|
11
16
|
```
|