How To List all the workbook links in a workbook using VBA in Excel?
Tags: tolistalltheworkbook
Published: 2021-10-18 12:00:51

---
title: How To List all the workbook links in a workbook using VBA in Excel?
published: true
date: 2021-10-16 17:56:58 UTC
tags: ToListAllTheWorkbook
canonical_url: https://geekexcel.com/how-to-list-all-the-workbook-links-in-a-workbook-using-vba-in-excel/
---

In this blog post, we will guide you on how to  **list all the Workbook links in a Workbook using VBA** in Excel. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, in the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Sub ListLinks()
    Dim aLinks As Variant
    aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
    If Not IsEmpty(aLinks) Then
        Sheets.Add
        For i = 1 To UBound(aLinks)
            Cells(i, 1).Value = aLinks(i)
        Next i
    End If
End Sub

```

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Save-the-Code-12.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Run-the-Code-12.png)<figcaption>Run the Code</figcaption>

- Finally, you will receive **output** to **list all the Workbook links** in a Workbook.

## Verdict

We hope that this tutorial gives you guidelines on how to  **list all the Workbook links in a Workbook using VBA** in Excel. Please leave a comment in case of any  **queries,**  and don’t forget to mention your valuable  **suggestions**  as well. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Related Articles:**

- **[Extract URL Links From Hyperlinks or To Convert Plain Text Links to Hyperlinks in Excel!!](https://geekexcel.com/extract-url-links-from-hyperlinks-or-to-convert-plain-text-links-to-hyperlinks-in-excel/)**
- **[How to Find and Break Broken Links in Excel Office 365?](https://geekexcel.com/how-to-find-and-break-broken-links-in-excel-office-365/)**
- **[Create a New Workbook in Excel 365 Using Shortcut](https://geekexcel.com/simple-shortcut-to-create-a-new-workbook-in-excel-365/)**
- **[Save Workbook in Microsoft Excel 365 – Easy Shortcut](https://geekexcel.com/shortcut-to-save-workbook-in-excel-365/)**
- **[Close Current Workbook in Microsoft Excel 365 – Useful Shortcut](https://geekexcel.com/shortcut-to-close-current-workbook-in-microsoft-excel-365/)**