Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named ranges and pasting formulas with named references | Excel Programming | |||
Named ranges scope / workbook/worksheet level named ranges- changeswith variable use... | Excel Programming | |||
union of named ranges based only on the names of those ranges | Excel Programming | |||
Copy data in named ranges to a newer version of the same template to identical ranges | Excel Programming | |||
Like 123, allow named ranges, and print named ranges | Excel Discussion (Misc queries) |