#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Naming

I have a simple code that sums a changing range as follows:

Sub AddTotal()
Dim rRange As Range
Set rRange = Range("C2", Range("C65536").End(xlUp))
Range("C65536").End(xlUp)(2, 1) = "=Sum(" & rRange.Address & ")"
End Sub

Question: Is there a way to name the range too, for recall in a ListBox?
It would have to replace the existing name definition as the range changes
each time data is added or deleted from the range.

Any suggestions would be appreciated. Thanks -Randy-

..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Naming

Randal,

Do you want to name the rRange range? If so, use

ThisWorkbook.Names.Add "TheName",rRange


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Randal W. Hozeski" wrote in message
news:gz_Bb.363158$ao4.1225214@attbi_s51...
I have a simple code that sums a changing range as follows:

Sub AddTotal()
Dim rRange As Range
Set rRange = Range("C2", Range("C65536").End(xlUp))
Range("C65536").End(xlUp)(2, 1) = "=Sum(" & rRange.Address &

")"
End Sub

Question: Is there a way to name the range too, for recall in a

ListBox?
It would have to replace the existing name definition as the

range changes
each time data is added or deleted from the range.

Any suggestions would be appreciated. Thanks -Randy-

.




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
Help with naming Mike Busch[_2_] Excel Discussion (Misc queries) 2 January 8th 08 12:04 AM
Tab Naming michelle Excel Worksheet Functions 8 October 13th 06 01:34 AM
Tab Naming michelle Excel Worksheet Functions 0 October 12th 06 10:19 PM
Tab Naming Johnny Excel Discussion (Misc queries) 2 August 29th 06 03:29 PM
Tab naming Pedro AM Excel Discussion (Misc queries) 1 April 3rd 06 12:31 PM


All times are GMT +1. The time now is 10:29 AM.

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"