Thread: Last Row Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Last Row Help

One way:

Public Sub CopyToNextRow()
Dim i As Long
For i = 1 To 10
With Worksheets(i)
With .Range("A" & .Rows.Count).End(xlUp)
.EntireRow.Copy .Offset(1, 0)
End With
End With
Next i
End Sub

In article ,
Michael168 wrote:

Can someone modify the macro below so that it will always copy the last
row and paste one row below when I run the macro.
The macro runs from sheet 1 - sheet 10

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 6/8/2004 by Michael
'

'
Sheets("Sheet 1").Select
Range("A240").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Range("A241").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Sheet 2").Select
Range("A240").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Range("A241").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("A242").Select

............. until Sheet 10

End Sub