ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Specify which sheet to paste to (https://www.excelbanter.com/excel-programming/364412-specify-sheet-paste.html)

Paul LeBlanc

Specify which sheet to paste to
 
I have recorded a simple macro and want to specify that it always pastes into
the sheet named 'Link'
here is my current code
Sub McrUpdateLink()
'
' McrUpdateLink Macro
' Macro recorded 06/15/2006
'

'
Cells.Select
Selection.Copy
ActiveSheet.Previous.Select
Cells.Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("A2").Select
ActiveSheet.Next.Select
Range("H2").Select
End Sub


Simon Lloyd[_772_]

Specify which sheet to paste to
 

I have changed a couple of lines below, not tried them but give it a go
it should work

Regards,
Simon

Sub McrUpdateLink()
'
' McrUpdateLink Macro
' Macro recorded 06/15/2006

Cells.Select
Selection.Copy
ActiveSheet.Previous.Select
Cells.Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=
_
False, Transpose:=False
Application.CutCopyMode = False
Range("A2").Select
Sheets("Link").Select 'I think this is the line you need
Range("H2").Select
ActiveSheet.paste 'and this one to paste in to H2 on the sheet named
Link
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=552359



All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com