I am trying to copy rows that have been inputted with a name in coloum C (data starts at C32). The code i have is below, it works fine if i am copying to a differenct sheet but i need to copy the rows c18:N26. Can anyone help?
Code:
Private Sub CommandButton1_Click()
Dim lr As Long, lr2 As Long, r As Long
Dim ws1 As Worksheet
Application.ScreenUpdating = False
Set ws1 = Sheets("Interface")
lr = ws1.Cells(Rows.Count, "d").End(xlUp).Row
For r = lr To 2 Step -1
lr2 = ws1.Cells(Rows.Count, "c").End(xlUp).Row + 1
If ws1.Range("c" & r).Value = "Donna" Or _
ws1.Range("c" & r).Value = "Laura" Or _
ws1.Range("c" & r).Value = "Sam" Or _
ws1.Range("c" & r).Value = "Sophie" Or _
ws1.Range("c" & r).Value = "Yvonne" Or _
ws1.Range("c" & r).Value = "Matt" Or _
ws1.Range("c" & r).Value = "Dan" Then
ws1.Rows(r).Copy Destination:=ws1.Range("c18:n26" & lr2)
End If
Next r
Application.ScreenUpdating = True
End Sub