range.createnames method
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.
|