![]() |
Name each Worksheet with a name?
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" |
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" |
All times are GMT +1. The time now is 06:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com