PC Review


Reply
Thread Tools Rate Thread

Copy row to first empty row in new sheet

 
 
Taylor
Guest
Posts: n/a
 
      22nd Jul 2008
I would like to:

1. Copy a row of data
2. Paste it into the first empty row on another sheet
3. Return to the sheet where the data was originally entered
4. Clear the information previously entered in the aforementioned row

Forgive me, but I know little to nothing about VBA language, so an
easy-to-understand response is greatly appreciated!

Thanks in advance!
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      22nd Jul 2008
Hi,

You don't say which row you want to copy so this copies row 1.

Alt + F11 to open VB editor
Doubleclick 'This workbook' and paste this in on the right

Sub copyit()
Sheets("Sheet1").Rows(1).Copy
lastrow = Sheets("Sheet2").Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
Sheets("Sheet2").Range("A" & lastrow).PasteSpecial
Sheets("Sheet1").Rows(1).ClearContents
End Sub

Mike

"Taylor" wrote:

> I would like to:
>
> 1. Copy a row of data
> 2. Paste it into the first empty row on another sheet
> 3. Return to the sheet where the data was originally entered
> 4. Clear the information previously entered in the aforementioned row
>
> Forgive me, but I know little to nothing about VBA language, so an
> easy-to-understand response is greatly appreciated!
>
> Thanks in advance!

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      22nd Jul 2008
Sub findbottom_paste22()
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = ActiveCell.EntireRow
Set rng2 = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
With rng1
.Copy Destination:=rng2
.EntireRow.Delete
End With
End Sub


Gord Dibben MS Excel MVP

On Tue, 22 Jul 2008 06:11:01 -0700, Taylor
<(E-Mail Removed)> wrote:

>I would like to:
>
>1. Copy a row of data
>2. Paste it into the first empty row on another sheet
>3. Return to the sheet where the data was originally entered
>4. Clear the information previously entered in the aforementioned row
>
>Forgive me, but I know little to nothing about VBA language, so an
>easy-to-understand response is greatly appreciated!
>
>Thanks in advance!


 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      22nd Jul 2008
You didn't say what row you are copying, so I am assuming it is the row you
are on (the one with the active cell on the active worksheet) when you
activate the macro. You do, however, have to change my worksheet reference
from Sheet8 which I used in my code to whatever the actual worksheet name is
(make sure it is wrapped in quote marks like I show in my example) where you
are copying the information to.

Sub MoveCurrentRow()
With ActiveCell.EntireRow
.Copy Worksheets("Sheet8").Cells(Rows.Count, "A").End(xlUp).Offset(1)
.Clear
End With
End Sub

Also note that all I do is "clear" the data from the current row because you
said "clear the information". If instead of just erasing the data, you
actually wanted to delete the entire row (so that you wouldn't have blank
rows remaining on your current sheet where you activated the macro from),
then use this code instead...

Sub MoveCurrentRow()
With ActiveCell.EntireRow
.Copy Worksheets("Sheet8").Cells(Rows.Count, "A").End(xlUp).Offset(1)
.Delete
End With
End Sub

Rick


"Taylor" <(E-Mail Removed)> wrote in message
news:B82B5552-8874-48DC-BAE4-(E-Mail Removed)...
>I would like to:
>
> 1. Copy a row of data
> 2. Paste it into the first empty row on another sheet
> 3. Return to the sheet where the data was originally entered
> 4. Clear the information previously entered in the aforementioned row
>
> Forgive me, but I know little to nothing about VBA language, so an
> easy-to-understand response is greatly appreciated!
>
> Thanks in advance!


 
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
Re: Button to copy row to first empty row on another sheet Gord Dibben Microsoft Excel Programming 2 4th May 2011 03:23 AM
Re: Button to copy row to first empty row on another sheet GS Microsoft Excel Programming 4 4th May 2011 01:20 AM
Copy rows with values in sheet 1 to next empty row in sheet2 Wes_A Microsoft Excel Programming 2 8th Mar 2010 04:25 AM
Copy Data from Sheet 1 to Empty Cell in Sheet 2 dtoland Microsoft Excel Programming 2 4th Nov 2009 06:48 PM
Copy row with an empty cell for each row in a sheet talista@gmail.com Microsoft Excel Misc 2 24th Apr 2007 05:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 AM.