VBA Macro to add a Particular Text in Each sheet.

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
I want a Macro that a same text will be copied to different sheets, but the condition is that the text will appear after the end of used rows of the sheet. I want to specify the sheet name in the Macro code & in Column E after the end of rows the Text will be appear.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
could you post a little more detail. Give us a sample of what you are saying "same text" contains. Give a sample of a couple of the rows.
 
Upvote 0
could you post a little more detail. Give us a sample of what you are saying "same text" contains. Give a sample of a couple of the rows.

apple.JPG

grape.JPG

orange.JPG
For example in the above 3 images the sheet names are Apple Orange & Grape. Apple sheet data ends in 14th row & Orange on 112th, Grape on 16th row. I want a Text in the next row of each sheet that "Taken Printout on 01.01.2017" in each sheet I want this, I have 100 sheets & I want the text in 80 sheets so In the code I want that I can mention the sheet name where I can insert the desired text.
 
Last edited:
Upvote 0
try this

Code:
Sub TakenDatesheetloop()
Dim WSCount As Long, i As Long, LR As Long
WSCount = Worksheets.Count

For i = 1 To WSCount
            
    LR = Sheets(i).Range("A" & Rows.Count).End(xlUp).Row
    Sheets(i).Range("E" & LR + 1) = "Taken Printout on " & Format(Date, "mm.dd.yyyy")
    
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,594
Members
452,656
Latest member
earth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top