Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste without selecting cell

Status
Not open for further replies.

davefish

Technical User
Joined
Jul 26, 2002
Messages
169
Location
GB
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
 
Range("A1").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PH,

Thanks, This worked great.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top