ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sequential names on Sequential pages (https://www.excelbanter.com/excel-worksheet-functions/6312-sequential-names-sequential-pages.html)

Salt4

Sequential names on Sequential pages
 
I'm trying to name the cells on sequential pages with sequential names:

Page "1", cell "A5" is named "house1"
Page "2", cell "A5" is named "house2"
Page "3", cell "A5" is named "house3"
.. . . and so on . . . .

Is there a way I can do this quickly with out going to each cell on each
page and naming them individually?

tjtjjtjt

Someone may have a simpler answer, but this short macro seems to do it:

Sub InstTxt()

Dim ShtNum As Byte
Dim Cntr As Byte
ShtNum = Worksheets.Count

For Cntr = 1 To ShtNum
Worksheets(Cntr).Select
Range("A5").Value = "house" & Cntr
Next Cntr

End Sub

You can put it into your file by pressing Alt+F11.
Then, choose Insert | Module
Copy and Paste

tj

"Salt4" wrote:

I'm trying to name the cells on sequential pages with sequential names:

Page "1", cell "A5" is named "house1"
Page "2", cell "A5" is named "house2"
Page "3", cell "A5" is named "house3"
. . . and so on . . . .

Is there a way I can do this quickly with out going to each cell on each
page and naming them individually?


tjtjjtjt

Forgot to mention, you may have to adjsut your Macro Security to Medium to
run this macro in the future.
Tools | Macro, Security
tj

"Salt4" wrote:

I'm trying to name the cells on sequential pages with sequential names:

Page "1", cell "A5" is named "house1"
Page "2", cell "A5" is named "house2"
Page "3", cell "A5" is named "house3"
. . . and so on . . . .

Is there a way I can do this quickly with out going to each cell on each
page and naming them individually?



All times are GMT +1. The time now is 03:29 PM.

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