macro problem

  • Thread starter Thread starter Pam
  • Start date Start date
P

Pam

I have a large worksheet, and I created a macro that when
ran would take me to a new row at the bottom of my
worksheet for input. For some reason it works exactly as
intended for the first time, then the second time it just
repeats the same routine on the same row, preventing the
user to advance to a newly formatted row. Code:
Range("A3").Select
Selection.End(xlDown).Select
Selection.Copy
Range("A63").Select
ActiveSheet.Paste
Range("E63").Select
Selection.End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Range("E63").Select
ActiveSheet.Paste
Range("G63").Select
Selection.End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Range("G63").Select
ActiveSheet.Paste
Range("H63").Select
Selection.End(xlUp).Select
Application.CutCopyMode = False
Selection.Copy
Range("H63").Select
ActiveSheet.Paste
Range("I63").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
End Sub
 
Pam,

Try This

Dim cLastRow As Long

cLastRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("A3").End(xlDown).Select
With ActiveCell
.Copy Destination:=Cells(cLastRow, "A")
Cells(cLastRow, "E").End(xlUp).Select
End With
With ActiveCell
.Copy Destination:=Cells(cLastRow, "E")
Cells(cLastRow, "G").End(xlUp).Select
End With
With ActiveCell
.Copy Destination:=Cells(cLastRow, "G")
Cells(cLastRow, "H").End(xlUp).Select
End With
With ActiveCell
.Copy Destination:=Cells(cLastRow, "H")
Cells(cLastRow, "I").Select
End With
ActiveWorkbook.Save


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top