|
▼[名前なし]あsd さん:
たたき台です。まずは、これを実行してみてください。
mergeシートにデータを統合します。
Sub test()
Dim p As String
Dim fn As String
Dim ws As Worksheet
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show Then
p = .SelectedItems(1) & "\"
Else
Exit Sub
End If
End With
Set ws = ThisWorkbook.Worksheets("merge")
ws.UsedRange.Offset(1).ClearContents
fn = Dir(p & "*.xlsx")
Do While fn <> ""
With Workbooks.Open(p & fn)
.Sheets(1).UsedRange.Offset(1).Copy _
ws.Range("a" & Rows.Count).End(xlUp).Offset(1)
.Close False
End With
fn = Dir()
Loop
End Sub
|
|