Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Creating range name for a range selection

My existing code is a bit predetermined as in the example:

ActiveWorkbook.Names.Add Name:="CodeLookup",
RefersToR1C1:="=CostCodes!R1C2:R200C8"

I can't figure out how to change this to refer to the current region
selection such as:

ActiveWorkbook.Names.Add Name:="CodeLookup", RefersToR1C1;= current
selection

Mervyn


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Creating range name for a range selection

Mervyn,

Try this out:

Range("A1").CurrentRegion.Name = "TestRange"

John

"Mervyn Thomas" wrote in message
...
My existing code is a bit predetermined as in the example:

ActiveWorkbook.Names.Add Name:="CodeLookup",
RefersToR1C1:="=CostCodes!R1C2:R200C8"

I can't figure out how to change this to refer to the current region
selection such as:

ActiveWorkbook.Names.Add Name:="CodeLookup", RefersToR1C1;= current
selection

Mervyn




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - Selection Instead of Range Cue Excel Discussion (Misc queries) 2 January 15th 10 05:08 PM
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Range Selection cfspahn24 Excel Discussion (Misc queries) 3 April 14th 06 01:29 PM
Can I use named range in data range box when creating pie chart? BJackson Charts and Charting in Excel 2 August 17th 05 05:37 PM


All times are GMT +1. The time now is 08:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"