Named Ranges in VBA

B

Bruce

I need to know how to name a range using VBA. The example as follows
does not work.
Selection.Name = "Named Range".
What is the correct syntax for this?
 
D

Dave Peterson

The syntax is correct. Then Name isn't valid (contains a space).

This worked ok for me:

Selection.Name = "Named_Range"
 
Top