Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to use the method to create names for columns in "Myrange" with
the statement: Myrange.createnames Top:=True. It doesn't seem to execute properly. First, it won't execute until I answer the question "Do you want to redefine 'TDA'? TDA is the first entry in the second row first column, and I have to answer the question for each entry in the first column of every row. After I do that it executes and all the columns get named as expected, except the first column. The name for the first column appears in the name manager list but it is the original range less the first row and the first column--it is supposed to be just the first column. Also a lot of the first column entries end up in the name manager list and are names for their entire row. Does anyone have any experience with this method and know whether it works properly. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can suppress the prompt with this: Application.DisplayAlerts = False
I don't follow you exactly on the problem with the resulting range names but if you get the right result manually you might try recording a macro as you do it and then replace "Selection" in the resulting code with the exact range, e.g., Range("A1:D4").CreateNames Top:=True. This would result in names being created for the ranges A2:A4, B2:B4, etc. -- Jim "DaveL" wrote in message ... | I'm trying to use the method to create names for columns in "Myrange" with | the statement: Myrange.createnames Top:=True. It doesn't seem to execute | properly. First, it won't execute until I answer the question "Do you want | to redefine 'TDA'? TDA is the first entry in the second row first column, | and I have to answer the question for each entry in the first column of every | row. After I do that it executes and all the columns get named as expected, | except the first column. The name for the first column appears in the name | manager list but it is the original range less the first row and the first | column--it is supposed to be just the first column. Also a lot of the first | column entries end up in the name manager list and are names for their entire | row. Does anyone have any experience with this method and know whether it | works properly. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Thanks! Did the manual approach from a worksheet and it worked fine, including the first row. However, first I had to delete all the names in the name manager list that were referred to that range. After I did that there were no prompts and the first row did get named properly.. When I did it manually I notice that the default for "Left" was "True" as was "Top". All others were false. That could have been the reason some of the rows were named by the left column--I needed to set "Left" to "false". Anyway, I'm convinced it work and Ill play with it in VBA language to see what needs to be set/deleted to make it work that way. Dave "Jim Rech" wrote: You can suppress the prompt with this: Application.DisplayAlerts = False I don't follow you exactly on the problem with the resulting range names but if you get the right result manually you might try recording a macro as you do it and then replace "Selection" in the resulting code with the exact range, e.g., Range("A1:D4").CreateNames Top:=True. This would result in names being created for the ranges A2:A4, B2:B4, etc. -- Jim "DaveL" wrote in message ... | I'm trying to use the method to create names for columns in "Myrange" with | the statement: Myrange.createnames Top:=True. It doesn't seem to execute | properly. First, it won't execute until I answer the question "Do you want | to redefine 'TDA'? TDA is the first entry in the second row first column, | and I have to answer the question for each entry in the first column of every | row. After I do that it executes and all the columns get named as expected, | except the first column. The name for the first column appears in the name | manager list but it is the original range less the first row and the first | column--it is supposed to be just the first column. Also a lot of the first | column entries end up in the name manager list and are names for their entire | row. Does anyone have any experience with this method and know whether it | works properly. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Range Method | Excel Programming | |||
"PasteSpecial method of Range class failed" when range Number of Rows 2000 | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Adding named range gives error "method range of object _Global failed " | Excel Programming | |||
Pass a range to a method? | Excel Programming |