Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default defining a range of cells in excel using cell content

I am attempting to create a macro that will allow me to define a range
of cells, with the "name" for said range of cells coming from the
content of a cell. Rather than manually entering the name of the range
of cells using the insertnamedefine function, I am hoping to create a
macro that automatically selects a cell's content as the name for said
range. Any insight would be most appreciated. Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default defining a range of cells in excel using cell content

This takes the value in cell A1 and uses that as the name for D1:D10 on
sheet1.

Dim theName As String
theName = Cells(1).Value
ActiveWorkbook.Names.Add Name:=theName, RefersToR1C1:= _
"=Sheet1!R1C4:R10C4"

Hope this helps
Rowan

wrote:
I am attempting to create a macro that will allow me to define a range
of cells, with the "name" for said range of cells coming from the
content of a cell. Rather than manually entering the name of the range
of cells using the insertnamedefine function, I am hoping to create a
macro that automatically selects a cell's content as the name for said
range. Any insight would be most appreciated. Thanks

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
testing range of cells for part of cell content Daniel Excel Worksheet Functions 5 March 25th 10 08:14 PM
defining unique range of cells for different sheets as the same n. KSAPP Excel Discussion (Misc queries) 1 March 30th 05 07:18 PM
Drop down defining content of a range of cells philm13 Links and Linking in Excel 5 March 25th 05 03:31 PM
Defining Range of For Each Loop for Cells and Worksheets ExcelMonkey[_190_] Excel Programming 2 February 22nd 05 01:04 PM
Defining a variable Range for cells with values in them! John Baker Excel Programming 1 January 19th 05 02:04 PM


All times are GMT +1. The time now is 04:14 PM.

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

About Us

"It's about Microsoft Excel"