ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Repeating a Macro For Each Selected Worksheet (https://www.excelbanter.com/excel-worksheet-functions/64640-repeating-macro-each-selected-worksheet.html)

carl

Repeating a Macro For Each Selected Worksheet
 
I have this macro:

Sub temp()

Range("B19").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveWorkbook.Names.Add Name:="NameOfWorksheetHere", RefersToR1C1:= _
"='throttling 01102005'!R19C2:R115C6"
End Sub

Is it possible to run this macro on all worksheets in the workbook and have
the name of the worksheet inserted into the "NameOfWorksheetHere" ?

Thank you in advance.


All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com