• 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.

Need VBA Macro Code for Delete and Dynamic Copy to Sheet 2

Manan

New Member
Hi ,
I have a requirement where in first i want to delete the contents of the Sheet2 from Column A to E and then do the Dynamic Copy from Sheet1 to Sheet2 . I have code for ynamic Copy from Sheet1 to Sheet2 but the beforing running this i want to add code for Delete in Sheet2 , so that first it deletes the content and then copy the fresh data whenever i click the Copy button. Can some one give me additional code to be added in below.

Code:
Sub DynCopy()

Dim strRng As Long
strRng = Range("H" & Rows.Count).End(xlUp).Row
Sheets("Sheet1").Range("H13:L" & strRng).Copy Destination:=Sheets("Sheet2").Range("A1")
End Sub
 
Back
Top