MACRO to paste row into next empty row

Joined
Sep 26, 2010
Messages
1
Reaction score
0
Can anybody help me with a macro I'm trying to create. I have a worksheet in which I'd like macro to copy all of row 16 and paste it into the next empty row of the worksheet. I'm trying to learn how to write macros but I can't figure this one out. I found the following code online but I'm not sure how to use it correctly into what I'm trying to do:

Function xlLastRow(Optional WorksheetName As String) As Long

' find the last populated row in a worksheet

If Worksheet Name = vbNullString Then
WorksheetName = ActiveSheet.Name
End If
With Worksheets(WorksheetName)
xlLastRow = .Cells.Find("*", .Cells(1), xlFormulas, _
xlWhole, xlByRows, xlPrevious).Row
End With

End Function


Any help is appreciated!
 
Last edited:
Back
Top