internal links b/w sheets of merged workbooks, using VBA (EXCEL MACROS) My aim is to merge all workbooks having multiple sheets from any specified folder to one workbook of multiple sheets. The problem is I don’t want external links to be maintained, If I use &quot;breaklink&quot; it will break all links(external links) b/w sheets of all workbooks. what I exactly I need is, After merging all sheets of workbooks in one workbook, I need links b/w these merged sheets.
CODE FOR MERGE ALL WORKBOOKS INTO ONE WORKBOOK :
Sub merge()

Dim FolderPath As String

Dim Filename As String

Dim Sheet As Worksheet

Application.ScreenUpdating = False

FolderPath = &quot;C:\Users\Samiya jabbar\Desktop\test&quot;

Filename = Dir(FolderPath)

Do While Filename &lt;&gt; &quot;&quot;

Workbooks.Open Filename:=FolderPath &amp; Filename, ReadOnly:=True

For Each Sheet In ActiveWorkbook.Sheets

Sheet.Copy After:=ThisWorkbook.Sheets(1)

Next Sheet

Workbooks(Filename).Close

Filename = Dir()

Loop

Application.ScreenUpdating = True

End Sub
```
Here are a couple of pointers:

FolderPath should be a constant because it's value will never change
Using a wildcard Filter with the path will ensure that you open the correct files
Although ActiveWorkbook does the job, it is best to get in the habit of using qualified references
Workbook.Worksheets returns a Worksheets Collection (not to be confused with a normal VBA Collection)
Worksheets can be used to perform group operations on all of it's Worksheets at one time
Download RubberDuck.  Among its many great features is Code Indentation.  It will save you a ton of time reformatting and show you unclosed code blocks


Sub merge()
    Const FolderPath As String = &quot;C:\Users\Samiya jabbar\Desktop\test&quot;
    Const Pattern As String = &quot;*.xl*&quot;
    
    Dim Filename As String

    Dim Sheet As Worksheet

    Application.ScreenUpdating = False

    Filename = Dir(FolderPath &amp; Pattern)

    Do While Filename &lt;&gt; &quot;&quot;

        Workbooks.Open(Filename:=FolderPath &amp; Filename, ReadOnly:=True).Worksheets.Move After:=ThisWorkbook.Sheets(1)

        Filename = Dir()

    Loop

    Application.ScreenUpdating = True

End Sub