How to Loop Through Each Worksheet & Write Text in Same Cells in Excel?
Tags: toloopthrougheachwor, vbamacros
Published: 2021-09-23 09:54:11

---
title: How to Loop Through Each Worksheet & Write Text in Same Cells in Excel?
published: true
date: 2021-09-21 08:15:28 UTC
tags: ToLoopThroughEachWor,VBAMacros
canonical_url: https://geekexcel.com/how-to-loop-through-each-worksheet-write-text-in-same-cells-in-excel/
---

In this article, you will learn how to **loop through each Worksheet** & **write text in same cells** in Excel Office 365 using its basic examples. 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, you need to  **create**  **3 sheets** in an Excel Workbook.

![](https://geekexcel.com/wp-content/uploads/2021/09/Create-3-Sheets.png)<figcaption>Create 3 Sheets</figcaption>

- 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 mycode()
For Each Worksheet InThisWorkbook.Sheets
Range("A1") = "Exceltip"
Next
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-62.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-36.png)<figcaption>Run the Code</figcaption>

- Here, macro will **enter text**  **in**  **sheet 1 in cell A1**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Sheet-1-Output.png)<figcaption>Sheet 1 Output</figcaption>

- Finally, the same way, macro will **enter text in all the sheets in cell A1**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Sheet-2-Output.png)<figcaption>Sheet 2 Output</figcaption>

![](https://geekexcel.com/wp-content/uploads/2021/09/Sheet-3-Output.png)<figcaption>Sheet 3 Output</figcaption>

## Non VBA solution

- You need to **hold the CTRL key** and then select **Sheet1, Sheet2 &Sheet3**.
- Then, you will be able to **create temporarily groups** of all the worksheets.
- Now, you have to click in **cell A1**  **in any Sheet** and then **type your text**.

## Sum-Up

In the above short tutorial, we have illustrated how to **loop through each Worksheet** & **write text in same cells** in Excel Office 365. Hope you like this article. Please feel free to state your **query** or **feedback** for the above article. Thank you so much for Reading!! To learn more, check out **[Geek Excel](https://geekexcel.com/)!! **and [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Related Articles:**

- **[How To Loop Through Sheets In Excel Using VBA?](https://geekexcel.com/how-to-loop-through-sheets-in-excel-using-vba/)**
- **[Excel VBA Loops Statements in Office 365 ~ With Examples!!](https://geekexcel.com/excel-vba-loops-statements-in-office-365-with-examples/)**
- **[How to Write To A Word File Using Macros (VBA) in Excel Office 365?](https://geekexcel.com/how-to-write-to-a-word-file-using-macros-vba-in-excel-office-365/)**
- **[How to record a macro and then how to modify the code in Excel VBA?](https://geekexcel.com/how-to-record-a-macro-and-then-how-to-modify-the-code-in-excel-vba/)**
- **[Worksheet Area in Excel- A Detailed Guide in MS Excel 365](https://geekexcel.com/a-detailed-guide-to-know-about-worksheet-area-in-ms-excel-365/)**