Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default adding rows, pasting values then empty sheet

Hi:
If I import a report weekly (and therefore though it has the same columns -
5, the row number varies) onto a worksheet "synergy". How can I move all this
to the worksheet "lifetime" (same workbook) at the next available row at the
bottom of the table located in "lifetime". With the values still intacted
(colums include date and numbers). then erase the synergy worksheet ready for
the nexts weeks update?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default adding rows, pasting values then empty sheet

Try
'Replace Sheet1 by Synergy and Sheet2 by Lifetime everywhere...

Sub CopyRow()
Dim Answer As String
Dim LastRowOnSheet1, LastRowOnSheet2 As Long
With Worksheets("Sheet1")
LastRowOnSheet1 = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
If LastRowOnSheet1 = 1 Then MsgBox "Nothing to Copy"
With Worksheets("Sheet2")
LastRowOnSheet2 = .Cells(.Rows.Count, "A").End(xlUp).Row
If LastRowOnSheet2 = 1 And .Cells(1, "A").Value = "" Then
LastRowOnSheet2 = 0
End If
'Answer = InputBox("Find which number in Row H and copy it?")
Worksheets("Sheet1").UsedRange. _
Copy .Range("A" & (LastRowOnSheet2 + 1))
End With
Worksheets("Sheet1").UsedRange.ClearContents
End Sub

"misscharliebrown" wrote:

Hi:
If I import a report weekly (and therefore though it has the same columns -
5, the row number varies) onto a worksheet "synergy". How can I move all this
to the worksheet "lifetime" (same workbook) at the next available row at the
bottom of the table located in "lifetime". With the values still intacted
(colums include date and numbers). then erase the synergy worksheet ready for
the nexts weeks update?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default adding rows, pasting values then empty sheet

thank you so much.. that was some sweet code

"Sheeloo" wrote:

Try
'Replace Sheet1 by Synergy and Sheet2 by Lifetime everywhere...

Sub CopyRow()
Dim Answer As String
Dim LastRowOnSheet1, LastRowOnSheet2 As Long
With Worksheets("Sheet1")
LastRowOnSheet1 = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
If LastRowOnSheet1 = 1 Then MsgBox "Nothing to Copy"
With Worksheets("Sheet2")
LastRowOnSheet2 = .Cells(.Rows.Count, "A").End(xlUp).Row
If LastRowOnSheet2 = 1 And .Cells(1, "A").Value = "" Then
LastRowOnSheet2 = 0
End If
'Answer = InputBox("Find which number in Row H and copy it?")
Worksheets("Sheet1").UsedRange. _
Copy .Range("A" & (LastRowOnSheet2 + 1))
End With
Worksheets("Sheet1").UsedRange.ClearContents
End Sub

"misscharliebrown" wrote:

Hi:
If I import a report weekly (and therefore though it has the same columns -
5, the row number varies) onto a worksheet "synergy". How can I move all this
to the worksheet "lifetime" (same workbook) at the next available row at the
bottom of the table located in "lifetime". With the values still intacted
(colums include date and numbers). then erase the synergy worksheet ready for
the nexts weeks update?

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
Adding some values on a sheet??? Dugholes New Users to Excel 1 September 3rd 08 03:32 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
cutting and pasting rows from one sheet to another generates error JT Spitz Excel Discussion (Misc queries) 7 February 14th 06 07:06 PM
Adding Rows to Master Sheet Excel Newbie New Users to Excel 1 December 23rd 04 10:56 PM


All times are GMT +1. The time now is 02:33 AM.

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"