Predefine a named range for an exported SQL Server Reporting Services report
0
Q:
Predefine a named range for an exported SQL Server Reporting Services report
How can you predefine a named range for an SQL Server Reporting Services report exported to Excel? In particular, the named range must have a specific name, along with referring to a set of cells with specific columns for all rows rendered for the given table control. I am running SQL Server 2005 SP3 with Microsoft Excel 2003.
ASKED: Feb 10 2009  9:05 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
475 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
This function will name a range for you.

Function NameRange(strName As String, strRange as String) As Boolean

strName = Replace(strName," ","_")

On Error Resume Next
ThisWorkbook.Names.Add Name:=strName, _
RefersTo:="=" & strRange, Visible:=True
If Err = 0 Then
NameRange = True
End If
On Error Goto 0

End Function


To call it, pass in the name you want, and the range it refers to. Ex:

Call NameRange("My Range","A1:B100")

The function returns boolean TRUE if successful. Also note that spaces are not allowed, so the function converts spaces to underscores.

HTH
Last Answered: Feb 11 2009  10:10 PM GMT by JP2112   475 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

TIP: Predefine a named range for an exported SQL Server Reporting Services report - DbRunas   0 pts.  |   Feb 12 2009  3:20AM GMT

[...] <a href="http://itknowledgeexchange.techtarget.com/itanswers/predefine-a-named-range-for-an-exported-sql-serv" title="http://itknowledgeexchange.techtarget.com/itanswers/predefine-a-named-range-for-an-exported-sql-serv" target="_blank">http://itknowledgeexchange.techtarget.co…</a>… [...]

 
0