Thanks Thanks:  9
Page 2 of 2 FirstFirst 12
Showing results 11 to 13 of 13

Thread: excel help needed

  1. #11
    Member Reputation: 192
    Join Date
    2011-06-14
    Location
    Algiers, Algeria
    Posts
    218


    1 out of 1 members found this post helpful.

    Default Re: excel help needed

    Hi;

    This merges only the first sheet, right!!, I have files contains a lot of sheets, sometimes I want to merge a specific one, please can you show us how to do it using this tool.

    Best Regards.

  2. #12
    Member Reputation: 20
    Join Date
    2015-03-13
    Posts
    6


    1 out of 1 members found this post helpful.

    Default Re: excel help needed

    Quote Originally Posted by Ghost78 View Post
    Hi;

    This merges only the first sheet, right!!, I have files contains a lot of sheets, sometimes I want to merge a specific one, please can you show us how to do it using this tool.

    Best Regards.
    you are right this tools cant allow s you to copy specific sheet but if you want there is a simple macro allow you to do that but you need to edit the path
    and the rows manualy.

    macro code :


    Sub XlsMerger()
    Dim bookList As Workbook
    'Add 2 new variables for sheets count
    Dim index As Integer

    Dim mergeObj, dirObj, filesObj, everyObj As Object
    Application.ScreenUpdating = False
    Set mergeObj = CreateObject("Scripting.FileSystemObject")

    Set dirObj = mergeObj.Getfolder("C:\path to folder with excel file\")
    Set filesObj = dirObj.Files
    For Each everyObj In filesObj
    Set bookList = Workbooks.Open(everyObj)





    For index = 1 To Sheets.Count



    'set active sheet trhough iteration and copy
    bookList.Worksheets(index).Activate
    Range("A2:IV" & Range("A65536").End(xlUp).Row).Copy

    'move to target workbook, related sheet and paste
    ThisWorkbook.Worksheets(index).Activate
    Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
    Application.CutCopyMode = False

    'Next sheet
    Next index

    bookList.Close
    Next
    End Sub

  3. Thanks Ghost78, edinburgh thanked for this post
  4. #13
    VIP Member Reputation: 1228
    Join Date
    2008-06-18
    Location
    TESTBED
    Posts
    608


    Default Re: excel help needed

    can someone work the above script into excel and post it here..please?
    I've tried it and it seems not working...

Bookmarks

Bookmarks

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •