Find specific sheets in a workbook and combine them all in a sheet in same workbook

  • Hello,
    I have just created a macro for selecting specific sheets in a workbook by giving sheet names. Now I just want to combine all the sheets which I have selected into a single sheet in a same workbook.


    Here is the code for selecting specific sheets in a workbook.


    Code
    Sub test()
        Dim ws As Worksheet, flg As Boolean
        For Each ws In Sheets
            If LCase(ws.Name) Like "*apple*" Then
                ws.Select Not flg
                flg = True
            End If
        Next
    End Sub


    I don't know how to proceed with this.
    Please do the needful.


    Moderator Comment: Please read the forum rules you agreed to abide by when you joined. Pay particular attention to the part on Code Tags. I have added them for you today. Please comply in the future.

  • Re: Find specific sheets in a workbook and combine them all in a sheet in same workbo


    So which sheets do you want to combine?
    Only the sheets that have "apple" somewhere in the name?
    BTW, why would you want to select all these sheets?

  • Re: Find specific sheets in a workbook and combine them all in a sheet in same workbo


    Something like this could be a possibility.
    Might want to change the UsedRange part. Would need more info to tailor the code to your needs.


  • Re: Find specific sheets in a workbook and combine them all in a sheet in same workbo


    Single post and no return.


    Screams "cross post already answered" to me.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!