Name each Worksheet with a name?

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

Guest

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"
 
Your code is syntactically correct.

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

HTH
 
I need to write in a C# OFFICE PROJECT so this code wont work in codebehind
page of ThisWorkBook.cs page

I am looking for the C# conversion of the listed code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top