macro problem

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top