Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-11-2018, 11:13 PM
Shashi Kant Shashi Kant is offline Several Worksheets into one master Windows 7 32bit Several Worksheets into one master Office 2016
Novice
 
Join Date: May 2018
Posts: 16
Shashi Kant is on a distinguished road
Default Find a possible solution

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.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Several Worksheets into one master Master tab data list parsed out to applicable cells in applicable worksheets 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

Other Forums: Access Forums

All times are GMT -7. The time now is 03:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft