Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default adding rows to spreadsheet after macro is written

I need to add some rows and / or columns to a spreadsheet. After I add the
columns / rows, the macros that I built blow up. I have tried adding $ signs
to the cell references, ie: Range("D56") becomes Range ("$D$56), but this
does not seem to work. In excel the formulas scale to reflect any row/col
additions or deletions.

Any thoughts on what I should do to the macro language to ensure that the
macro changes and the layout of the sheet changes?

Thanks
--
sd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default adding rows to spreadsheet after macro is written

I find that the best solution is to name the ranges that you want to use in
your macros. Then use the range names instead of the cell references.

--

Vasant



"iamn94" wrote in message
...
I need to add some rows and / or columns to a spreadsheet. After I add

the
columns / rows, the macros that I built blow up. I have tried adding $

signs
to the cell references, ie: Range("D56") becomes Range ("$D$56), but this
does not seem to work. In excel the formulas scale to reflect any row/col
additions or deletions.

Any thoughts on what I should do to the macro language to ensure that the
macro changes and the layout of the sheet changes?

Thanks
--
sd



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default adding rows to spreadsheet after macro is written

best to use a defined range name that will auto adjust
insertnamedefinename it mysumrange
in the refers to box
=offset($a$2,0,0,counta($a:$a,1)
look n help for offset. adjust to your needs

--
Don Guillett
SalesAid Software

"iamn94" wrote in message
...
I need to add some rows and / or columns to a spreadsheet. After I add

the
columns / rows, the macros that I built blow up. I have tried adding $

signs
to the cell references, ie: Range("D56") becomes Range ("$D$56), but this
does not seem to work. In excel the formulas scale to reflect any row/col
additions or deletions.

Any thoughts on what I should do to the macro language to ensure that the
macro changes and the layout of the sheet changes?

Thanks
--
sd



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
Adding new rows to an Excel spreadsheet niletrader Charts and Charting in Excel 0 October 21st 07 10:51 PM
Adding five new rows every 40 rows in a spreadsheet? Olzki Excel Discussion (Misc queries) 8 May 18th 07 02:14 AM
Sum only adding rows on page instead of entire spreadsheet - help Sarah Excel Discussion (Misc queries) 1 February 15th 06 11:46 PM
running-total formulas written from one spreadsheet to another Neumeister Excel Programming 3 December 11th 04 12:14 AM
Adding new rows to spreadsheet Roy[_5_] Excel Programming 4 December 19th 03 12:01 AM


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