Ask a questionAsk a question
 

AnswerExcel Spread Sheet Name

  • Wednesday, November 04, 2009 11:41 PMshimam Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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

  • Tuesday, November 10, 2009 6:02 AMPraxy1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    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 Sub
    use 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

All Replies

  • Thursday, November 05, 2009 5:01 AMPraxy1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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
  • Thursday, November 05, 2009 10:50 PMNeeraja DivakaruniMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Excel sheet naming is one of the features coming up in the next release of Reporting Services (SQL Server Reporting Services 2008 R2)
  • Friday, November 06, 2009 2:29 AMRobert BrucknerMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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.
  • Sunday, November 08, 2009 1:33 AMshimam Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Actually we are using SQL 2005.
    simam
  • Monday, November 09, 2009 7:38 AMPraxy1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    sorry i forgot to include version in my above post..
     its for SQL 2005... U cant do
    Praxy
  • Tuesday, November 10, 2009 1:18 AMshimam Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Praxy,

    Please explain how to do in MACROS.

    Really appreciate it.

    Thank you.
    simam
  • Tuesday, November 10, 2009 6:02 AMPraxy1 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    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 Sub
    use 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