PC Review


Reply
Thread Tools Rate Thread

automatically insert rows

 
 
Slub
Guest
Posts: n/a
 
      15th Jun 2009
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 With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      15th Jun 2009
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" <(E-Mail Removed)> wrote in message
news:1A11E729-5BEA-47D2-A810-(E-Mail Removed)...
> 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 With Quote
 
KC
Guest
Posts: n/a
 
      15th Jun 2009
Would you consider putting Total ahead of the list?

"Slub" <(E-Mail Removed)> wrote in message
news:1A11E729-5BEA-47D2-A810-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically insert new rows petee Microsoft Excel Misc 2 23rd Feb 2011 04:29 PM
How do I automatically insert rows colwyn Microsoft Excel Misc 13 11th Sep 2008 09:16 PM
Automatically Insert New Rows =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 0 12th Jun 2007 10:54 PM
insert new rows automatically nic Microsoft Excel Misc 2 30th Jun 2004 08:13 PM
Automatically Insert Rows Markus Microsoft Excel Programming 1 20th Aug 2003 04:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 PM.