Specify which sheet to paste to

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top