Thread: naming sheets
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default naming sheets

Hi Christian,

Here is one way

Private iSheet As Long

Private Sub Workbook_NewSheet(ByVal Sh As Object)
iSheet = Worksheets.Count
Sh.Name = "Tabelle" & iSheet
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

"Christian Galbavy" wrote in message
...
Hello!

I think there is a general problem with excel. When I have several sheets
(over 20), and I want to rename a sheet, this takes about 30 seconds. I do
not know why and what is happening in the background, but it is a big
problem for my program. I use the "add" function to insert new sheets, and
the I use the "sheet.name" function to rename the inserted sheets. I have
more than 40 sheets in my workbook and as I said, the renaming-process

takes
up to a minute.
When I insert a new sheet, my german excel version automatically names the
sheets like "Tabelle1", "Tabelle2", ...
Is there a function to set a certain name here, befor the insertion

happens?
Or does anybody know, why the renaming function takes so much time?
Thanks for your help.

Regards
Christian Galbavy