I am trying to paste a set of value to a sheet without it taking focus. The issue is .Range("A1").Select but if I remove this I cannot paste correctly. Can anyone advide the best way to work around this?
Sub Copy_CTO()
'
' Copy_CTO Macro
Application.EnableCancelKey = xlDisabled
Application.ScreenUpdating = False
With ActiveWorkbook.Sheets("BOMM")
'
.Range("A20:F37").Copy
Sheets("CTO").Visible = True
With ActiveWorkbook.Sheets("CTO")
'how to paste without selecting ?
.Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
If MyValues.Map_res <> "X" Then
[F20].Value = WorksheetFunction.Sum(Range("F1:F18")) + MyValues.Mapping_Cost
Else
[F20].Value = WorksheetFunction.Sum(Range("F1:F18"))
End If
End With
End With
End Sub
Sub Copy_CTO()
'
' Copy_CTO Macro
Application.EnableCancelKey = xlDisabled
Application.ScreenUpdating = False
With ActiveWorkbook.Sheets("BOMM")
'
.Range("A20:F37").Copy
Sheets("CTO").Visible = True
With ActiveWorkbook.Sheets("CTO")
'how to paste without selecting ?
.Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
If MyValues.Map_res <> "X" Then
[F20].Value = WorksheetFunction.Sum(Range("F1:F18")) + MyValues.Mapping_Cost
Else
[F20].Value = WorksheetFunction.Sum(Range("F1:F18"))
End If
End With
End With
End Sub