Sequential names on Sequential pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
Forgot to mention, you may have to adjsut your Macro Security to Medium to
run this macro in the future.
Tools | Macro, Security
tj
 
Back
Top