other
vba 複数ブックã‹ã‚‰ä¸€è¦§ã«ã¾ã¨ã‚ã‚‹
'個別ã®è«‹æ±‚書ブックã‹ã‚‰ã€ä¸€è¦§ã«ã¾ã¨ã‚ã‚‹
Sub データå–ã‚Šè¾¼ã¿()
Application.ScreenUpdating = False
Dim i As Long
Dim cnt As Long
Dim file
Dim filebook
Dim seikyu As Workbook
cnt = Sheets("一覧").Range("A10000").End(xlUp).Row + 1
file = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(file) Then
For Each filebook In file
Workbooks.Open (filebook)
Set seikyu = ActiveWorkbook
For i = 10 To seikyu.Sheets(1).Range("B10000").End(xlUp).Row
Workbooks("請求書.xlsm").Sheets("一覧").Range("A" & cnt).Value _
= seikyu.Sheets(1).Range("B5").Value
Workbooks("請求書.xlsm").Sheets("一覧").Range("B" & cnt).Value _
= seikyu.Sheets(1).Range("B" & i).Value
Workbooks("請求書.xlsm").Sheets("一覧").Range("C" & cnt).Value _
= seikyu.Sheets(1).Range("E" & i).Value
Workbooks("請求書.xlsm").Sheets("一覧").Range("D" & cnt).Value _
= seikyu.Sheets(1).Range("F" & i).Value
cnt = cnt + 1
Next
seikyu.Close
Next
End If
End Sub
Was this helpful?
Similar Posts