LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Continuation of message Range Names

I have a macro to add range names to a workbook and the names and ranges are
listed in a worksheet. I'm able to add the names, but the range is shown as
text. Here is what I have:

Sub PPQDefineRangeName()
'
' DefineNamefromList Macro
' Macro recorded 1/16/2006 by Barb Reinhardt
'
Dim lastrow
Dim rangename
Dim seriesrange
Dim CurBook
Dim i
Dim sht

CurBook = Application.ActiveWorkbook.Name
lastrow = Worksheets("RangeName").Cells(Rows.Count, "a").End(xlUp).Row
Debug.Print lastrow
For i = 2 To lastrow
rangename = Workbooks(CurBook).Worksheets("RangeName").Range(" a" &
i).Value
seriesrange = Workbooks(CurBook).Worksheets("RangeName").Range(" c" &
i).Value
sht = Workbooks(CurBook).Worksheets("RangeName").Range(" d" & i).Value
Debug.Print rangename; seriesrange; sht
'range name can't have a "'" or a "-" or a "%" or a " " or a "." or "("
or ")" or "+"
'Added the following
'Sheets(sht).Activate
ActiveWorkbook.Names.Add Name:=rangename, RefersToR1C1:=seriesrange
'Exit Sub
Next

End Sub

When I look at the data in the named ranges, it looks like:

="OFFSET(InterTeam-ChartLabel,4,0)"
but it should look like
=OFFSET(InterTeam-ChartLabel,4,0)

The data is displayed in the original sheet as:
OFFSET(InterTeam-ChartLabel,4,0)

How do I get the " to go away so that the ranges are useful?

Thanks in advance,
Barb Reinhardt


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
Continuation of a macro Dan Wood Excel Discussion (Misc queries) 2 December 20th 09 11:54 AM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
formula continuation with the paint too. Fay New Users to Excel 2 March 17th 08 10:56 PM
continuation from yesterday Mindy Excel Discussion (Misc queries) 4 June 22nd 06 11:13 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"