Hello Everyone,
i am trying to get this code working.....but i don't understand where is the error. I have in column U the drop down menu where the word "Completed " should trigger the code. I created a Button, assigned this macro to activate the code...but still nothing.
i am trying to get this code working.....but i don't understand where is the error. I have in column U the drop down menu where the word "Completed " should trigger the code. I created a Button, assigned this macro to activate the code...but still nothing.
VBA Code:
Sub CutPaste()
Dim c As Range
Dim j As Integer
Dim Source As Worksheet
Dim Target As Worksheet
' Change worksheet designations as needed
Set Source = ActiveWorkbook.Worksheets("Sheet1")
Set Target = ActiveWorkbook.Worksheets("Completed")
j = Target.Range("A" & Rows.Count).End(xlUp).Row + 1 ' Start copying 1 down from the last row on sheet
For Each c In Source.Range("U1:U1000") ' Do 1000 rows
If c = "Completed" Then
Source.Rows(c.Row).Copy Target.Rows(j)
Source.Rows(c.Row).Cut Target.Rows(j)
Target.Range("U" & j).Value = Date
j = j + 1
End If
Next c
End Sub