#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default Ranges

I realize Excel is not the best tool for this but this is where I need to
start. I have a multi-worksheet file. One worksheet has raw data, over 700
rows, 20 columns. The other worksheets have a variety of complex formulas,
conditionals, and arrays. Over time I will be adding more rows. Is the best
way to handle this without changing every formula to name each range and
reset the range when I add rows.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Ranges

hi
the trick is to reset the range automaticly using an event like the before
save event.
this macro will reset the range each time you save the file. it will
remember where you are in the file and return to the place you were at after
the macro has run wheather you are adding rows or doing something else. you
may notice a quick "blip" as the macro runs. you will have to adjust the
macro to fit your data ie your sheet name and your range name.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

Dim rng As Range
Dim sht As Worksheet
dim srng as range

Set rng = ActiveCell
Set sht = ActiveSheet

Sheets("yourSheetName").Select
Range("A1").Select
set srng =Range(Range("A1"), _
Range("A1").Offset(0, 1) _
.End(xlDown).Offset(0, 20))
ActiveWorkbook.Names.Add Name:="YourRangeName", _
RefersToR1C1:= srng

sht.Select
rng.Select

End Sub

if you have multiple sheet and multiple ranges then add to the above macro
to accomodate the additional sheets and ranges.

Regards
FSt1

"PAL" wrote:

I realize Excel is not the best tool for this but this is where I need to
start. I have a multi-worksheet file. One worksheet has raw data, over 700
rows, 20 columns. The other worksheets have a variety of complex formulas,
conditionals, and arrays. Over time I will be adding more rows. Is the best
way to handle this without changing every formula to name each range and
reset the range when I add rows.

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Ranges

Name the ranges and make them dynamic ranges.

See Debra Dalgeish's site for naming dynamic ranges.

http://www.contextures.on.ca/xlNames01.html#Dynamic


Gord Dibben MS Excel MVP

On Wed, 14 Nov 2007 13:32:01 -0800, PAL wrote:

I realize Excel is not the best tool for this but this is where I need to
start. I have a multi-worksheet file. One worksheet has raw data, over 700
rows, 20 columns. The other worksheets have a variety of complex formulas,
conditionals, and arrays. Over time I will be adding more rows. Is the best
way to handle this without changing every formula to name each range and
reset the range when I add rows.

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
Sum the ranges Andri Excel Worksheet Functions 5 March 24th 07 04:36 PM
ranges Filipemr Excel Discussion (Misc queries) 1 November 27th 05 08:37 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
using ranges Guido Excel Worksheet Functions 1 February 18th 05 03:53 PM
Sum ranges Arnie Excel Worksheet Functions 1 November 15th 04 08:38 PM


All times are GMT +1. The time now is 11:52 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"