Hi
This code is very good but can it remove the empty rows from the task sheet once the data has been transferred to the Archive sheet.This way there is no gaps between tasks in the Task sheet
Best Regards
Jeff
patel
07-10-2013, 03:24 PM
Sub ArchiveCompleted()
Dim rng As Range
With Worksheets("TASKS")
For Each rng In .Range("E5:E" & Application.Max(.Cells(.Rows.Count, "E").End(xlUp).Row, 5))
If LCase(rng.Value) = "completed" Then
With Worksheets("ARCHIVE")
.Cells(.Rows.Count, "B").End(xlUp)(2).Resize(, 2).Value = Array(rng.Offset(, -3).Value, rng(1, 2).Value)
rng.Offset(, -3).Resize(, 5).ClearContents
End With
End If
Next rng
With .Range("B5:B" & Application.Max(.Cells(.Rows.Count, "B").End(xlUp).Row, 5))
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End With
End Sub
The code transfers tasks completed to Archive sheet but it also comes up with a Error - Runtime Error 1004 No Cells Were Found
This line of code -
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Any thoughts
Thanks
Jeff
Admin
07-11-2013, 07:25 AM
Hi
Add the following line
on error resume next
before the line
.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.