View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ardus Petus Ardus Petus is offline
external usenet poster
 
Posts: 718
Default Name each Worksheet with a name?

Your code is syntactically correct.

I don't undersand why you name your sheets "temp x" just before you name
them something else.

HTH
--
AP

"Stokh" a écrit dans le message de news:
...
I have looked high and dry for this information and cant seem to find what
I
am needing to do. I have tried it everywhich way and cant seem to get
anything to work, so any help would be GREATLY appreciated! Thank you in
advance!

I have some VB code that I need to write in C# to allow me to name each
tab(sheet) in an excel workbook, everything I try isnt working right.

Private Sub SetupWorksheet()
Dim count As Integer
For count = 1 To ThisWorkbook.Sheets.Count
ThisWorkbook.Sheets(count).Name = "Temp " & count
Next

ThisWorkbook.Sheets(1).Name = "ALL SUMMARY"
ThisWorkbook.Sheets(2).Name = "Preferred"
ThisWorkbook.Sheets(3).Name = "Standard"