回答編集履歴
1
追記
test
CHANGED
@@ -49,3 +49,27 @@
|
|
49
49
|
End Sub
|
50
50
|
|
51
51
|
```
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
---
|
56
|
+
|
57
|
+
mayu-さんのを借りるとこんな風にもできそうです。
|
58
|
+
|
59
|
+
```VBA
|
60
|
+
|
61
|
+
Sub sample()
|
62
|
+
|
63
|
+
With ThisWorkbook.Worksheets(1).UsedRange.Resize(, 1).Offset(, 1)
|
64
|
+
|
65
|
+
.Value = 1
|
66
|
+
|
67
|
+
.Resize(.Rows.Count - 1).Offset(1).FormulaR1C1 = "=IF(R[-1]C[-1]=RC[-1],R[-1]C+1,1)"
|
68
|
+
|
69
|
+
.Value = .Value
|
70
|
+
|
71
|
+
End With
|
72
|
+
|
73
|
+
End Sub
|
74
|
+
|
75
|
+
```
|