![]() |
#3
|
|||
|
|||
![]() Code:
Option Explicit Option Base 1 Private Sub CommandButton1_Click() Application.ScreenUpdating = False Dim wkb As Workbook Dim i As Integer Dim wbName(5) As String wbName(1) = "Car.xlsx" wbName(2) = "Bikes.xlsx" wbName(3) = "HGV.xlsx" wbName(4) = "Vans.xlsx" wbName(5) = "Other.xlsx" For i = 1 To 5 Set wkb = Workbooks.Open(ThisWorkbook.Path & "\" & wbName(i)) wkb.Worksheets(1).Range("A1").CurrentRegion.Offset(1, 0).Select Selection.Resize(Selection.Rows.Count - 1).Select Selection.Copy ThisWorkbook.Worksheets(i).Range("A2") wkb.Close savechanges:=True Next i Application.ScreenUpdating = True End Sub Last edited by Shashi Kant; 05-12-2018 at 05:09 AM. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
kiwimtnbkr | Excel Programming | 11 | 10-28-2017 01:38 PM |
Editable text box in master slide not appearing once closing master slide mode | tparnicott | PowerPoint | 1 | 06-17-2016 04:13 AM |
How do I set default workSHEETs? | CanvasShoes | Excel | 1 | 08-03-2015 02:39 AM |
Add worksheets to workbook | boboles | Excel | 2 | 01-26-2015 07:42 AM |
Linking Workbooks/Entire Worksheets to Identical in Master | taxacct | Excel | 2 | 10-01-2014 11:22 AM |