回答編集履歴

1

.Valueをつけました

2021/10/01 22:36

投稿

syousuke.33
syousuke.33

スコア312

test CHANGED
@@ -10,9 +10,11 @@
10
10
 
11
11
  Dim 光熱費 As Long
12
12
 
13
+
14
+
13
15
  Dim 食費 As Long
14
16
 
15
- Dim i As Long, n As Long, m As Long
17
+ Dim i As Long, n As Long
16
18
 
17
19
  Sub Macro1()
18
20
 
@@ -20,13 +22,13 @@
20
22
 
21
23
  Sheets("入力").Select
22
24
 
23
- 日付 = Range("B2")
25
+ 日付 = Range("B2").Value
24
26
 
25
- 家賃 = Range("B3")
27
+ 家賃 = Range("B3").Value
26
28
 
27
- 光熱費 = Range("B4")
29
+ 光熱費 = Range("B4").Value
28
30
 
29
- 食費 = Range("B5")
31
+ 食費 = Range("B5").Value
30
32
 
31
33
 
32
34
 
@@ -38,11 +40,11 @@
38
40
 
39
41
  If 日付 = Cells(1, i) Then
40
42
 
41
- Cells(2, i) = 家賃
43
+ Cells(2, i).Value = 家賃
42
44
 
43
- Cells(3, i) = 光熱費
45
+ Cells(3, i).Value = 光熱費
44
46
 
45
- Cells(4, i) = 食費
47
+ Cells(4, i).Value = 食費
46
48
 
47
49
  Sheets("入力").Select
48
50