View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] eric@ericjtidd.com is offline
external usenet poster
 
Posts: 3
Default Macro to edit Range Name

I'm still fiddling with this and thought I had the answer. The range
should just be the data in a particular column. When I use the
following macro, the range ends up being ALL of the data on the sheet.
Any ideas what I am doing wrong?

Sheets("Sheet2").Select
Range("A4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("rangea").CurrentRegion.Name = "rangea"


Range("B4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("rangeb").CurrentRegion.Name = "rangeb"

Range("C4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("rangec").CurrentRegion.Name = "rangec"

Range("D4").Select
Range(Selection, Selection.End(xlDown)).Select
Range("ranged").CurrentRegion.Name = "ranged"