View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default adding range name that includes a sheet name

Try... RefersTo:="=" & strRangeAddress
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"KarenH"
wrote in message
I am attempting to add ranges to a sheet based on another spreadsheet.

I have named the range name strRangeName, and the corresponding range
address as strRangeAddress. However, the range addresses will include
worksheet names as well as ranges, for example: 'S-S-0'!$B$12:$D$63

The following statement in my code is failing:
ActiveWorkbook.Sheets(strSheetName).Names.Add Name:=strRangeName,
RefersTo:=strRangeAddress
I'm fairly certain it's due to the range name, but I"m not sure of a way
around it.
Any ideas? Thanks in advance