Add debug to show available worksheets when not found
This commit is contained in:
@@ -40,7 +40,16 @@ Sub FillFromKukanMaster(ByVal ws As Worksheet, ByVal rowNum As Long, Optional By
|
||||
On Error Resume Next
|
||||
Set wsKukan = ThisWorkbook.Worksheets("区間メンテナンス")
|
||||
On Error GoTo 0
|
||||
If wsKukan Is Nothing Then Exit Sub
|
||||
|
||||
If wsKukan Is Nothing Then
|
||||
Dim wsList As String
|
||||
Dim s As Worksheet
|
||||
For Each s In ThisWorkbook.Worksheets
|
||||
wsList = wsList & s.Name & vbCrLf
|
||||
Next
|
||||
MsgBox "Worksheet '区間メンテナンス' not found." & vbCrLf & vbCrLf & "Available sheets:" & vbCrLf & wsList, vbExclamation
|
||||
Exit Sub
|
||||
End If
|
||||
code = Trim(ws.Cells(rowNum, 3).Value)
|
||||
If code = "" Then Exit Sub
|
||||
lastRow = wsKukan.Cells(wsKukan.Rows.Count, 3).End(xlUp).Row
|
||||
|
||||
Reference in New Issue
Block a user