PC Review


Reply
Thread Tools Rate Thread

Add Row after last entry

 
 
Danielle0904
Guest
Posts: n/a
 
      24th Apr 2008
I am working in a workbook that has 5 sheets. Each sheet has different data
and calculations based on information in the first sheet.

What I want to do is
1. Find the last row on the first worksheet that has data in it. Copy that
row, and add a new row right below it with the copied information.

2. Go to the next worksheet and do the same thing.

3. Continue that process until all worksheets have a new row added to the
bottom.
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      24th Apr 2008
Is this what you want?

sub copylastrowoneachsheetdownone()
for each ws in worksheets
with ws
lr=.cells(rows.count,"a").end(xlup).row
.rows(lr).copy .rows(lr+1)
end with
next ws


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Danielle0904" <(E-Mail Removed)> wrote in message
news:AA52129F-C2BA-4763-A131-(E-Mail Removed)...
>I am working in a workbook that has 5 sheets. Each sheet has different
>data
> and calculations based on information in the first sheet.
>
> What I want to do is
> 1. Find the last row on the first worksheet that has data in it. Copy
> that
> row, and add a new row right below it with the copied information.
>
> 2. Go to the next worksheet and do the same thing.
>
> 3. Continue that process until all worksheets have a new row added to the
> bottom.


 
Reply With Quote
 
Danielle0904
Guest
Posts: n/a
 
      24th Apr 2008
Hi Don,
That worked for what I originally asked - but I forgot that there will be
times that the last row will have information - so the formulas will paste as
information and not blank.

How would you re-write the last line to copy the row and the paste special /
formulas?


"Don Guillett" wrote:

> Is this what you want?
>
> sub copylastrowoneachsheetdownone()
> for each ws in worksheets
> with ws
> lr=.cells(rows.count,"a").end(xlup).row
> .rows(lr).copy .rows(lr+1)
> end with
> next ws
>
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> (E-Mail Removed)
> "Danielle0904" <(E-Mail Removed)> wrote in message
> news:AA52129F-C2BA-4763-A131-(E-Mail Removed)...
> >I am working in a workbook that has 5 sheets. Each sheet has different
> >data
> > and calculations based on information in the first sheet.
> >
> > What I want to do is
> > 1. Find the last row on the first worksheet that has data in it. Copy
> > that
> > row, and add a new row right below it with the copied information.
> >
> > 2. Go to the next worksheet and do the same thing.
> >
> > 3. Continue that process until all worksheets have a new row added to the
> > bottom.

>
>

 
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
in a form automatic entry in a text box by entry other field valu ihsan Microsoft Access Forms 1 9th Sep 2008 09:27 PM
list box to verify data entry-can't stop auto trailing entry inclu =?Utf-8?B?R2xlbm4gJiB0aGUgZG9ncw==?= Microsoft Access Forms 1 23rd Nov 2007 05:33 PM
Auto update 3rd field in entry form from 1st 2 entry fields =?Utf-8?B?Vml2?= Microsoft Access Forms 2 11th Oct 2006 12:18 AM
Footer shows File:// entry instead of http:// entry for any web page printed earlrc_2000@yahoo.com Windows XP Internet Explorer 0 11th Jul 2006 07:10 PM
data entry attempt in any Excel page highlights cells, no entry =?Utf-8?B?TWlrZQ==?= Microsoft Excel Crashes 1 19th Feb 2006 01:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:35 AM.