Thread: [Solved] Daily Task Sheet - help
View Single Post
 
Old 03-19-2013, 05:23 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Malissa,

I believe the following is what you're after:
Code:
Sub TasksCompleted()
Application.ScreenUpdating = False
Dim WS1 As Worksheet, WS2 As Worksheet
Dim lRow1 As Long, lRow2 As Long, i As Long
Set WS1 = Sheets("Task Sheet")
Set WS2 = Sheets("Completed Tasks")
lRow1 = WS1.Range("E" & WS1.Cells.SpecialCells(xlCellTypeLastCell).Row).End(xlUp).Row
lRow2 = WS2.Range("A" & WS2.Cells.SpecialCells(xlCellTypeLastCell).Row).End(xlUp).Row
With WS1
  For i = 2 To lRow1
    If .Cells(i, 5).Value <> "" Then
      lRow2 = lRow2 + 1
      With WS2
        .Range("A" & lRow2).Value = WS1.Range("E" & i).Value
        .Range("B" & lRow2 & ":D" & lRow2).Value = WS1.Range("B" & i & ":D" & i).Value
      End With
      WS1.Range("A" & i & ":E" & i).ClearContents
    End If
  Next
End With
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote