• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to copy rows including formatting

ivanka2000

New Member
Hello
Can you please help me to change the macro that it copy from Planning sheet to complete sheet not only values but also formats (cell colours) based on the criterion?
Thank you
Code:
Sub MoveComplete()

colnum = 100 'enter number of columns to be copied to sheet complete

l1 = Sheets("Planning_2016").Range("A" & Rows.Count).End(xlUp).Row
For n = 5 To l1
k = l1 - n + 5
If UCase(Sheets("Planning_2016").Range("I" & k).Value) = UCase("completed") Then
l2 = Sheets("Complete").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Complete").Rows(l2).Value = Sheets("Planning_2016").Rows(k).Value
Sheets("Planning_2016").Rows(k).Delete
Else
End If
Next n
End Sub

Mod Edit: Code tags added
 
Last edited by a moderator:
Back
Top