How to Loop Through Each Worksheet & Write Text in Same Cells in Microsoft Excel

If you want a quick way to write same text in same cell position then this article is for you. In this article, we will learn how to loop through in all the worksheets & add similar text in same position.

 

Question): I have 3 sheets in a workbook & I want a macro to enter text in all the sheets in cell A1.

 

We need to follow the below steps:

 

  • Click on Developer tab
  • From Code group, select Visual Basic

image 2

 

Enter the following code in the standard module.

 

Sub mycode()

For Each Worksheet InThisWorkbook.Sheets

Range("A1") = "Exceltip"

Next

End Sub

image 1

 

In this way, in cell A1, we can write what we want, using VBA in order to save our time.

 

In case you want a non VBA solution then the similar task can be achieved by using Grouping in Excel.

 

  • We need to hold the CTRL key & then select Sheet1, Sheet2 &Sheet3
  • This way we will be able to create temporarily groups all the worksheets.
  • Click in cell A1 in any Sheet and then type your text

 

In this way, this data will appear in each sheet.

download

Excel

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.