Fix error handling order in FillFromKukanMaster
This commit is contained in:
@@ -39,8 +39,6 @@ Sub FillFromKukanMaster(ByVal ws As Worksheet, ByVal rowNum As Long, Optional By
|
|||||||
|
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
Set wsKukan = ThisWorkbook.Worksheets("区間メンテナンス")
|
Set wsKukan = ThisWorkbook.Worksheets("区間メンテナンス")
|
||||||
On Error GoTo 0
|
|
||||||
|
|
||||||
If wsKukan Is Nothing Then
|
If wsKukan Is Nothing Then
|
||||||
Dim wsList As String
|
Dim wsList As String
|
||||||
Dim s As Worksheet
|
Dim s As Worksheet
|
||||||
@@ -50,6 +48,7 @@ Sub FillFromKukanMaster(ByVal ws As Worksheet, ByVal rowNum As Long, Optional By
|
|||||||
MsgBox "Worksheet '区間メンテナンス' not found." & vbCrLf & vbCrLf & "Available sheets:" & vbCrLf & wsList, vbExclamation
|
MsgBox "Worksheet '区間メンテナンス' not found." & vbCrLf & vbCrLf & "Available sheets:" & vbCrLf & wsList, vbExclamation
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
On Error GoTo 0
|
||||||
code = Trim(ws.Cells(rowNum, 3).Value)
|
code = Trim(ws.Cells(rowNum, 3).Value)
|
||||||
If code = "" Then Exit Sub
|
If code = "" Then Exit Sub
|
||||||
lastRow = wsKukan.Cells(wsKukan.Rows.Count, 3).End(xlUp).Row
|
lastRow = wsKukan.Cells(wsKukan.Rows.Count, 3).End(xlUp).Row
|
||||||
|
|||||||
Reference in New Issue
Block a user