SQL Server Developer Center >
SQL Server Forums
>
SQL Server Reporting Services
>
Excel Spread Sheet Name
Excel Spread Sheet Name
- I have a report which has one tabe and one matrix. In matrix property I select insert page break before the matrix.
When I export the report in excel , matrix show in sheet2.
My Question is how to change the Sheet2 Name?
simam
Answers
Sub RenameTabs() ' Renames all worksheet tabs with each worksheet's cell A1 contents. 'If cell A1 has no content, then that tab is not renamed. For i = 1 To Sheets.Count If Worksheets(i).Range("A10").Value <> "" Then Sheets(i).Name = Worksheets(i).Range("A10").Value End If Next End Subuse the above code in excel macros...
what actually it does what ever the value is there in 10 the cell of the each sheet... it actually renames the excel sheet by the 10 th cell data
Praxy- Marked As Answer byJerry NeeMSFT, ModeratorFriday, November 13, 2009 6:17 AM
All Replies
- NO u cant set the sheet names.. by default it will take names as sheet1, sheet2
If u want to rename sheet names automatically... these can be done by using MACROS..
when u open the sheet every time the macro will run automatically to rename the sheet...
or u have to use third party tool... software artisans, where u can have good control while working with excel using ssrs.
http://www.softartisans.com/
Praxy - Excel sheet naming is one of the features coming up in the next release of Reporting Services (SQL Server Reporting Services 2008 R2)
- Btw, I showed how to accomplish this at the BI-436 session at SQL PASS earlier today, using a new feature in the upcoming CTP November of SQL Server 2008 R2. I plan to explain this in detail on my blog before the end of the month.
HTH,
Robert
Robert Bruckner http://blogs.msdn.com/robertbruckner
This posting is provided "AS IS" with no warranties, and confers no rights. - Actually we are using SQL 2005.
simam - sorry i forgot to include version in my above post..
its for SQL 2005... U cant do
Praxy - Praxy,
Please explain how to do in MACROS.
Really appreciate it.
Thank you.
simam Sub RenameTabs() ' Renames all worksheet tabs with each worksheet's cell A1 contents. 'If cell A1 has no content, then that tab is not renamed. For i = 1 To Sheets.Count If Worksheets(i).Range("A10").Value <> "" Then Sheets(i).Name = Worksheets(i).Range("A10").Value End If Next End Subuse the above code in excel macros...
what actually it does what ever the value is there in 10 the cell of the each sheet... it actually renames the excel sheet by the 10 th cell data
Praxy- Marked As Answer byJerry NeeMSFT, ModeratorFriday, November 13, 2009 6:17 AM


