Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Copy row to first empty row in new sheet

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Copy row to first empty row in new sheet

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Copy row to first empty row in new sheet

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
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!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy row to first empty row in new sheet

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" wrote in message
...
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
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
Copy row with an empty cell for each row in a sheet [email protected] Excel Discussion (Misc queries) 2 April 24th 07 05:18 AM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
copy only non-empty cells Dean[_8_] Excel Programming 12 February 7th 07 01:05 AM
copy all rows before empty row Calle Excel Programming 3 October 17th 06 02:20 PM
Copy last row with data to next empty row... Oreg[_52_] Excel Programming 0 November 2nd 05 01:05 AM


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