#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Named ranges

I have an Excel 2003 workbook with multiple named ranges. They all begin with
LF followed by the specific name (LFData, LFStuff, LFFoot, etc.) and are
found on various sheets in the workbook. Is it possible to create a function
to gather all of the LF named ranges and give me a total? I don't want to
individually put the named ranges in, I want Excel to do it for me. Based on
my example above it would find for me LFName, LFStuff, LFFoot and show me the
total of all three of these. However, I have more like 20 of these named
ranges.

If LFData = 5 and LFStuff = 1 and LFFoot = 2 the formula would return the
answer 8.

Thanks for the help. : )
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Named ranges

Maybe you can define another name?

Insert|Name|Define
Names in Workbook:
LFAll

Refers to:
=LFData,LFStuff,LFFoot,.....

Then you could use:
=sum(lfAll)

If all you ever wanted was to sum that range, you could use:

Insert|Name|Define
Names in Workbook:
LFSum

Refers to:
=sum(LFData,LFStuff,LFFoot,.....)

Then just use:
=LFSum
in a cell.

SheriTingle wrote:

I have an Excel 2003 workbook with multiple named ranges. They all begin with
LF followed by the specific name (LFData, LFStuff, LFFoot, etc.) and are
found on various sheets in the workbook. Is it possible to create a function
to gather all of the LF named ranges and give me a total? I don't want to
individually put the named ranges in, I want Excel to do it for me. Based on
my example above it would find for me LFName, LFStuff, LFFoot and show me the
total of all three of these. However, I have more like 20 of these named
ranges.

If LFData = 5 and LFStuff = 1 and LFFoot = 2 the formula would return the
answer 8.

Thanks for the help. : )


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Named ranges

Try this small macro:

Sub rangerover()
v = 0
Dim n As Name
For Each n In ActiveWorkbook.Names
v = v + Evaluate("=SUM(" & n.Name & ")")
Next
MsgBox (v)
End Sub

It will add up the values in all the Named Ranges in a workbook. It will
handle ranges that include more than one cell.

If you are not familiar with VBA:

1. ALT-F11 to bring up the VBE window
2 ALT-I
ALT-M to bring up a fresh module
3. paste the stuff in and close the VBE window

To execute:
Tools Macro Macros...
and select run.


--
Gary''s Student
gsnu200706


"SheriTingle" wrote:

I have an Excel 2003 workbook with multiple named ranges. They all begin with
LF followed by the specific name (LFData, LFStuff, LFFoot, etc.) and are
found on various sheets in the workbook. Is it possible to create a function
to gather all of the LF named ranges and give me a total? I don't want to
individually put the named ranges in, I want Excel to do it for me. Based on
my example above it would find for me LFName, LFStuff, LFFoot and show me the
total of all three of these. However, I have more like 20 of these named
ranges.

If LFData = 5 and LFStuff = 1 and LFFoot = 2 the formula would return the
answer 8.

Thanks for the help. : )

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
Named Ranges Joe Gieder Excel Worksheet Functions 2 February 16th 06 01:31 AM
Named Ranges davey Excel Discussion (Misc queries) 5 July 1st 05 05:31 PM
Named Ranges in VBA Bruce Excel Discussion (Misc queries) 1 June 17th 05 03:35 AM
3D Named Ranges David Excel Worksheet Functions 0 June 7th 05 05:22 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM


All times are GMT +1. The time now is 04:30 AM.

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"