回答編集履歴
3
数式を値に変換
test
CHANGED
@@ -14,7 +14,13 @@
|
|
14
14
|
|
15
15
|
Sub Macro1()
|
16
16
|
|
17
|
-
Range(Range("B2"), Cells(Cells(Rows.Count, 1).End(xlUp).Row, "B"))
|
17
|
+
With Range(Range("B2"), Cells(Cells(Rows.Count, 1).End(xlUp).Row, "B"))
|
18
|
+
|
19
|
+
.FormulaR1C1 = "=COUNTIF(R2C[-1]:RC[-1],RC[-1])"
|
20
|
+
|
21
|
+
.Value = .Value '数式を値に変換
|
22
|
+
|
23
|
+
End With
|
18
24
|
|
19
25
|
End Sub
|
20
26
|
|
2
addressの間違いを修正
test
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
B
|
1
|
+
B2セルに以下のセル関数を入力して必要な範囲にコピー
|
2
2
|
|
3
3
|
```
|
4
4
|
|
5
|
-
=COUNTIF(A$
|
5
|
+
=COUNTIF(A$2:A2,A2)
|
6
6
|
|
7
7
|
```
|
8
8
|
|
1
vbaの方法を追記
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
B1セルに以下のセル関数を入力して必要な範囲にコピー
|
2
2
|
|
3
3
|
```
|
4
4
|
|
@@ -6,4 +6,16 @@
|
|
6
6
|
|
7
7
|
```
|
8
8
|
|
9
|
+
|
10
|
+
|
9
|
-
B
|
11
|
+
VBAで同じことを実現するなら
|
12
|
+
|
13
|
+
```vb
|
14
|
+
|
15
|
+
Sub Macro1()
|
16
|
+
|
17
|
+
Range(Range("B2"), Cells(Cells(Rows.Count, 1).End(xlUp).Row, "B")).FormulaR1C1 = "=COUNTIF(R2C[-1]:RC[-1],RC[-1])"
|
18
|
+
|
19
|
+
End Sub
|
20
|
+
|
21
|
+
```
|