Thanks for the advice, I have almost no idea what Im doing at most times. I have the code pasted below. It works just how I want it to. There any 'tips' you can give me how I could clean it up?
Sub NewGrassWeek()
Dim c As Range, r As Integer
Rows("3:250").Select
Selection.Delete Shift:=xlUp
Set wsHistory = Sheets("Grass Cutting")
Set wsDaily = Sheets("Customers")
Set c = wsHistory.Range("A3:A6666")
Set x = wsDaily.Range("A3:A6666")
r = 3
Do Until Worksheets("Customers").Cells(r, 9) = ""
If Worksheets("Customers").Cells(r, 9) = "y" Then
Worksheets("Grass Cutting").Cells(r, 1) = Worksheets("Customers").Cells(r, 1)
Worksheets("Grass Cutting").Cells(r, 2) = Worksheets("Customers").Cells(r, 2)
Worksheets("Grass Cutting").Cells(r, 3) = Worksheets("Customers").Cells(r, 3)
Worksheets("Grass Cutting").Cells(r, 4) = Worksheets("Customers").Cells(r, 4)
Worksheets("Grass Cutting").Cells(r, 5) = Worksheets("Customers").Cells(r, 5)
Worksheets("Grass Cutting").Cells(r, 6) = Worksheets("Customers").Cells(r, 6)
Worksheets("Grass Cutting").Cells(r, 7) = Worksheets("Customers").Cells(r, 7)
Worksheets("Grass Cutting").Cells(r, 8) = Worksheets("Customers").Cells(r, 8)
Worksheets("Grass Cutting").Cells(r, 12) = Worksheets("Customers").Cells(r, 10)
Application.ScreenUpdating = True
End If
r = r + 1
Loop
EndRow = Range("A1:A" & Range("A65536").End(xlUp).Row).Rows.Count
LastRow = EndRow
Range("a1").Select
For i = 1 To EndRow
Range("a" & i).Select
If ActiveCell.Row > LastRow Then
End If
If WorksheetFunction.CountIf(Range("A1:A250" & EndRow), ActiveCell.Value) > 1 Then
Selection.EntireRow.Delete
i = i - 1
EndRow = EndRow - 1
LastRow = EndRow
End If
Next i
Dim lrow As Long
For lrow = 250 To 3 Step -1
If IsEmpty(Range("A" & lrow)) Then Range("A" & lrow).EntireRow.Delete
Next lrow
End Sub
Bookmarks