LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Confusion Using Named Ranges

On Feb 16, 10:21*am, Dave Peterson wrote:
Dim myStr as string

For N = 1 To intHdrEnd
* mystr = myHdrArray(1, N)
* mystr = replace(mystr, chr(34),"_")
* mystr = replace(mystr, " ", "_")
* 'then use mystr as the name
* activecell.entirecolumn.name = mystr

There are other characters/strings that aren't legal for names, either.

wrote:

<<snipped







I'm very close to having this work as needed.


If I can edit the code that creates eachnamedrange so there are no
double quotes, all else works.
I found a post by OssieMac (Feb 5th) that states:


"The code that I have given you will create thenamedrange correctly
without
the double quotes. "


I cannot find any additional information on exactly what that code is.


This is the code I'm currentlyusingto create mynamedranges.
myHdrArray is an array that contains
each column header in order.


Dim intHdrEnd As Integer


'NAME A RANGE THAT REFERS TO EACH COLUMN BY HEADER NAME
Range("a1").Select
Selection.End(xlToRight).Select
intHdrEnd = ActiveCell.Column
Range("a1").Select
Dim shtMain As String
shtMain = "DATE SUMMARY"
For N = 1 To intHdrEnd
* * ActiveWorkbook.Names.Add Name:=CStr(myHdrArray(1, N)),
RefersTo:=Worksheets(shtMain).Range(ActiveCell.Col umn)
* * ActiveCell.Offset(0, 1).Select
* * If N = intHdrEnd Then Exit Sub
Next N


Any help correctly creating these defined names would be GREATLY
appreciated.


Thank you once again. *Without the help, I would be unable to get this
working.
hglembin


--

Dave Peterson- Hide quoted text -

- Show quoted text -


BINGO! Many thanks for your patience and willingness to help.

v/r,
hglembin
 
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
Named ranges and pasting formulas with named references Dude3966 Excel Programming 2 October 8th 08 04:15 PM
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... christian_spaceman Excel Programming 3 December 24th 07 01:15 PM
union of named ranges based only on the names of those ranges sloth Excel Programming 3 October 2nd 06 03:18 AM
Copy data in named ranges to a newer version of the same template to identical ranges handstand Excel Programming 0 August 21st 06 03:51 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM


All times are GMT +1. The time now is 02:49 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"