Sub shushu() Dim folder As String Dim file As String Dim book As Workbook Dim i As Integer Dim j As Integer Dim k As Integer Dim h As Integer i = 2 h = 2 With Application.FileDialog(msoFileDialogFolderPicker) If .Show = True Then folder = .SelectedItems(1) End If End With file = Dir(folder & "\*.xlsx") Do While file <> "" Set book = Workbooks.Open(folder & "\" & file) j = 0 k = 0 Do While book.Worksheets("アンケート").Cells(6 + j, 2) <> "" ThisWorkbook.Worksheets("Q1").Cells(i + j, 2).Value = book.Worksheets("アンケート").Cells(6 + j, 2).Value j = j + 1 Loop Do While book.Worksheets("アンケート").Cells(13 + k, 2) <> "" ThisWorkbook.Worksheets("Q2").Cells(h + k, 2).Value = book.Worksheets("アンケート").Cells(13 + k, 2).Value k = k + 1 Loop i = i + j h = h + k file = Dir() book.Close Loop End Sub