Share via

VBA paste in current sheet

Anonymous
2017-10-12T06:41:35+00:00

Hello,

I have written a very simple macro

   Sheets("Day Template").Select

    Range("A4:E13").Select

    Range("E13").Activate

    Selection.Copy

    Sheets(Sheets.Count).Select

    ActiveSheet.Paste

I'm essentially copying and pasting a template by using a macro button. This currently pastes in the last sheet in the work book. I would like it to paste where ever I want it to, (i.e. any sheet and location).

i.e. I select a cell, press the macro button within that worksheet, and it pastes in that cell.

I've tried a few methods including using "thisworksheet" etc.

I'm sure this is very simple but I am fairly new to this. 

Thanks for your help!

Oliver

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2017-10-12T07:05:57+00:00

    Again:

    Please never use SELECT, SELECTION, ACTIVECELL, it is slow and error prone. Always refer to the objects directly.

      Sheets("Day Template").Range("A4:E13").Copy

      ActiveSheet.Paste

    Andreas.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2017-10-12T12:07:48+00:00

    Thanks again Andreas. Much appreciated!

    Was this answer helpful?

    0 comments No comments