MyRange
is Nothing
if there is no matching value so try this
new line
If Not MyRange1 Is Nothing Then MyRange1.Copy Sheets("KS").[a1]
In place of this
remove lines
MyRange1.Select
Selection.Copy
Sheets("KS").Select
Range("A1").Select
ActiveSheet.Paste