回答編集履歴

2

追記

2021/03/12 10:05

投稿

jinoji
jinoji

スコア4592

test CHANGED
@@ -7,3 +7,61 @@
7
7
  =EXACT(Asheet!1:1048576,Bsheet!1:1048576)
8
8
 
9
9
  ```
10
+
11
+
12
+
13
+ ---
14
+
15
+ VBAで一から書くならこんな感じ?
16
+
17
+
18
+
19
+ ```VBA
20
+
21
+ Function SheetCompare(ws1 As Worksheet, ws2 As Worksheet) As Boolean
22
+
23
+
24
+
25
+ Dim rng1 As Range, rng2 As Range
26
+
27
+ Set rng1 = ws1.UsedRange
28
+
29
+ Set rng2 = ws2.UsedRange
30
+
31
+
32
+
33
+ If rng1.Address <> rng2.Address Then Exit Function
34
+
35
+
36
+
37
+ If rng1.Count = 1 Then
38
+
39
+ If rng1.Value <> rng2.Value Then Exit Function
40
+
41
+ End If
42
+
43
+
44
+
45
+ Dim arr1, arr2, r, c
46
+
47
+ arr1 = rng1.Value
48
+
49
+ arr2 = rng2.Value
50
+
51
+ For r = 1 To rng1.Rows.Count
52
+
53
+ For c = 1 To rng1.Columns.Count
54
+
55
+ If arr1(r, c) <> arr2(r, c) Then Exit Function
56
+
57
+ Next c, r
58
+
59
+
60
+
61
+ SheetCompare = True
62
+
63
+
64
+
65
+ End Function
66
+
67
+ ```

1

追記

2021/03/12 10:05

投稿

jinoji
jinoji

スコア4592

test CHANGED
@@ -1 +1,9 @@
1
1
  範囲指定でシート全体を選択するには、見出しエリアの左隅(Aの横、1の上)をクリックするか、CTRL+A を押下します。
2
+
3
+
4
+
5
+ ```
6
+
7
+ =EXACT(Asheet!1:1048576,Bsheet!1:1048576)
8
+
9
+ ```