Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically insert rows

I am working on a spreadsheet for a non-profit group, it keeps a running
total of items purchased. I am having trouble making a macro that will auto
insert rows above the total line. It looks something like this:

Recept# Name Item Code Check# Check$ Cash Total



Total

The donations can change every month and they have to remove any blank rows
befor turning in. So it seems to me the best way would be to auto insert
lines as needed. Any Ideas?

Thank you.

Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default automatically insert rows

assumimg totals in column G

Rows(Range("G1").End(xlDown).Row).Insert

BUT are your totals formulae? eg =SUM(R[-1]C:R2C)
if so then inserting a row will not quite work... your formula will just
point at a row higher
ie =SUM(R[-2]C:R2C)

I'd suggest locking the formula to a blank row immediately above the totals

so if your data is rows 8 to 50
have your totals in row 52 and your formula like =SUM(G2:G51)
now, inserting at row 51 leave the formula valid, =SUM(G2:G52)

and use

Rows(Range("G1").End(xlDown).Row)-1.Insert




"Slub" wrote in message
...
I am working on a spreadsheet for a non-profit group, it keeps a running
total of items purchased. I am having trouble making a macro that will
auto
insert rows above the total line. It looks something like this:

Recept# Name Item Code Check# Check$ Cash Total



Total

The donations can change every month and they have to remove any blank
rows
befor turning in. So it seems to me the best way would be to auto insert
lines as needed. Any Ideas?

Thank you.

Thank you!


  #3   Report Post  
Posted to microsoft.public.excel.programming
KC KC is offline
external usenet poster
 
Posts: 55
Default automatically insert rows

Would you consider putting Total ahead of the list?

"Slub" wrote in message
...
I am working on a spreadsheet for a non-profit group, it keeps a running
total of items purchased. I am having trouble making a macro that will
auto
insert rows above the total line. It looks something like this:

Recept# Name Item Code Check# Check$ Cash Total



Total

The donations can change every month and they have to remove any blank
rows
befor turning in. So it seems to me the best way would be to auto insert
lines as needed. Any Ideas?

Thank you.

Thank you!


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
Automatically Insert New Rows petitpiti Excel Discussion (Misc queries) 1 February 28th 11 09:18 AM
Insert a rows automatically jetanddug Excel Worksheet Functions 3 October 31st 09 03:15 AM
Automatically Insert New Rows Eric Excel Discussion (Misc queries) 0 June 12th 07 10:54 PM
automatically insert rows Samuel[_4_] Excel Programming 1 October 5th 04 02:02 PM
Automatically Insert Rows Markus Excel Programming 1 August 20th 03 04:09 PM


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