View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Arnold[_3_] Arnold[_3_] is offline
external usenet poster
 
Posts: 76
Default Define Names in Workbook through Code

Hi Gurus,

I'm trying to find a way for Excel to lump various columns into
different named ranges based on the names or headings of the columns.
There will be five different types of columns that will repeat
horizontally, eventually extending to about column 200, and each column
with the same heading should be included in its corresponding named
range.

Instead of manually having to do something like...
Range("U:U,Y:Y").Select
Range("U:U,Y:Y,AC:AC").Select
Range("U:U,Y:Y,AC:AC,AJ:AJ,AO:AO").Select
Range("U:U,Y:Y,AC:AC,AJ:AJ,AO:AO,AS:AS,AW:AW").Sel ect
Range("U:U,Y:Y,AC:AC,AJ:AJ,AO:AO,AS:AS,AW:AW,BA:BA ").Select

Can Excel do it automatically?

Thanks,
Arnold