PDA

View Full Version : Help with code to copy to another worksheet



werra2006
03-04-2013, 03:56 AM
I got this code to copy stuff from Raw data worksheet which has a Dynamics Atlas table to another worksheet named input. However, I noticed that some records are duplicated so I want the code modified to only copy unique records based on criteria in column B of the "Raw data" worksheet.

Also, the table is not always fixed to start at Row b10 so i need the code to identify in column B the header LogID and then start copying rows after that header.

: pray2: : pray2: : pray2: : pray2: : pray2: : pray2: :help :help :help :help :help :help

Thanks guys



Sub Copy_atlas_table()
Application.ScreenUpdating = False

With Worksheets("Input")
.Range("A2:S2" & .Cells(Rows.Count, "G").End(xlUp).Row).ClearContents
End With
With Worksheets("Raw data")
.Range("B10:T10" & .Cells(Rows.Count, "G").End(xlUp).Row).Copy Destination:=Sheets("Input").Range("A2")
End With
Application.ScreenUpdating = True
End Sub