How To Mail every Worksheet with address in cell A1 using VBA in Excel?
Tags: tomaileveryworksheet, vbamacros
Published: 2021-09-30 05:37:59

---
title: How To Mail every Worksheet with address in cell A1 using VBA in Excel?
published: true
date: 2021-09-28 07:49:31 UTC
tags: ToMailEveryWorksheet,VBAMacros
canonical_url: https://geekexcel.com/how-to-mail-every-worksheet-with-address-in-cell-a1-using-vba-in-excel/
---

In this article, you will learn how to **mail every worksheet with an address in cell A1** using VBA in Microsoft Excel. Let’s see them below!! Get the 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://geekexcel.com/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 Mail_every_Worksheet()
    Dim strDate As String
    Dim sh As Worksheet
    Application.ScreenUpdating = False
    For Each sh In ThisWorkbook.Worksheets
        If sh.Range("a1").Value Like "*@*" Then
            sh.Copy
            strDate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss")
            ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
                                & " " & strDate & ".xls"
            ActiveWorkbook.SendMail ActiveSheet.Range("a1").Value, _
                                    "This is the Subject line"
            ActiveWorkbook.ChangeFileAccess xlReadOnly
            Kill ActiveWorkbook.FullName
            ActiveWorkbook.Close False
        End If
    Next sh
    Application.ScreenUpdating = True
End Sub

```

- You need to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-86-1024x512.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://geekexcel.com/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://geekexcel.com/wp-content/uploads/2021/09/Run-the-Code-55.png)<figcaption>Run the Code</figcaption>

- Finally, you receive **mail with an address in cell A1** in every worksheet using VBA in Excel.

## Conclusion

We hope that this tutorial gives you guidelines on how to **mail every worksheet with an address in cell A1** using VBA in Microsoft 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/) **!!**

**Continue Reading:**

- **[Excel Formulas to Find the Same Date in Next Year ~ Simple Guide!!](https://geekexcel.com/excel-formulas-to-find-the-same-date-in-next-year/)**
- **[How To Mail the Activeworkbook using VBA in Microsoft Excel?](https://geekexcel.com/how-to-mail-the-activeworkbook-using-vba-in-microsoft-excel/)**
- **[How To Delete Rows In Different Sheets Through Excel VBA?](https://geekexcel.com/how-to-delete-rows-in-different-sheets-through-excel-vba/)**