View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default VB programming interactive macroes

Hi Nils,

If I understand yourr latest post correctly, you want to rename each
worksheet in the workbook and the new name is in cell A1 of each sheet.

If this corresponds to your requirements, try:

Sub Tester()

Dim WS As Worksheet

For Each WS In ActiveWorkbook.Worksheets
WS.Name = WS.Range("A1").Value
Next WS

End Sub

Change A1 to the cell containing the worksheet name.


---
Regards,
Norman




"Nils Morten Blakstad" wrote in message
...
Thanks again
I - by Your help - is getting closer to the solution.
But sadly I still dont get it right...
The macro command is sucsessfull when inserting spreadsheet no 2, but:
When inserting the 3rd,4th (and so on...)spreadsheet in the workbook,
the macro will not function (it referes to "sheet2" all the way).

Can I still hope to be uplightend of Your kindly competence once more?



Nils Morten Blakstad


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!