回答編集履歴
2
修正(どんどん長くなる…)
answer
CHANGED
@@ -10,10 +10,15 @@
|
|
10
10
|
|
11
11
|
エラー処理あり版
|
12
12
|
```VBA
|
13
|
-
With Cells(
|
13
|
+
With Cells(1, 1)
|
14
14
|
If .Hyperlinks.Count > 0 Then
|
15
15
|
sd = Split(.Hyperlinks.Item(1).SubAddress, "!")
|
16
|
+
For Each ws In Worksheets
|
17
|
+
If ws.Name = sd(0) Then
|
16
|
-
|
18
|
+
Debug.Print ws.Index
|
19
|
+
Exit For
|
20
|
+
End If
|
21
|
+
Next
|
17
22
|
End If
|
18
23
|
End With
|
19
24
|
```
|
1
エラー処理追加
answer
CHANGED
@@ -6,4 +6,14 @@
|
|
6
6
|
```
|
7
7
|
|
8
8
|
Cellsの位置は適宜修正してください。
|
9
|
-
またエラー処理もしていないので、適当に修正願います。
|
9
|
+
またエラー処理もしていないので、適当に修正願います。
|
10
|
+
|
11
|
+
エラー処理あり版
|
12
|
+
```VBA
|
13
|
+
With Cells(2, 1)
|
14
|
+
If .Hyperlinks.Count > 0 Then
|
15
|
+
sd = Split(.Hyperlinks.Item(1).SubAddress, "!")
|
16
|
+
Debug.Print Worksheets(sd(0)).Index
|
17
|
+
End If
|
18
|
+
End With
|
19
|
+
```
|