Paste an Excel VBA Template into the Selected Worksheet and Cell
Question details
The user needs an Excel VBA macro to paste a template starting at the cell selected when the macro runs.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A user clicks a macro button after selecting a destination worksheet and cell.
- Observed behavior
- The macro currently pastes the template into the last worksheet instead of the selected worksheet and cell.
Confirm that the workbook containing the macro has a worksheet named Day Template and that A4:E13 is the range to copy. Enable macros if prompted, and make sure the destination has enough empty space for a 10-row by 5-column range.
Copy the template range directly to the active cell
Use the selected cell as the top-left destination so the template is pasted on the currently active worksheet.
The source range is referenced directly, so the macro does not need to select or activate the template sheet. ActiveCell refers to the selected cell on the active worksheet when the macro runs.
In Excel, open Developer > Visual Basic, then open the module containing your macro or choose Insert > Module.
Add this macro, or replace the existing paste logic with its copy line: Sub PasteDayTemplate() ThisWorkbook.Worksheets("Day Template").Range("A4:E13").Copy Destination:=ActiveCell End Sub
Right-click the worksheet button, choose Assign Macro, select PasteDayTemplate, and click OK. If the button is already assigned to your existing macro, keep that assignment and update the macro instead.
Open the destination worksheet, select the cell that should be the template's top-left corner, and click the macro button. The copied range will fill 10 rows and 5 columns starting at that cell.
Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm) to retain the VBA code.

Work with Excel Templates in WPS Spreadsheets
WPS Office is a free, lightweight alternative for working with spreadsheet templates in a familiar interface. Open compatible Excel files and continue editing with minimal disruption; check VBA support in your WPS version before relying on macros.

Frequently Asked Questions
Why does the macro paste into the wrong worksheet?
The existing code may explicitly reference the last worksheet or activate it before pasting. Use the destination worksheet's active cell with Range.Copy Destination:=ActiveCell, and select the intended worksheet and cell before running the macro.
Does the selected cell need to match the template's original position?
No. Select any suitable destination cell before clicking the macro button. Excel uses it as the top-left corner of the copied A4:E13 range.
What if my template is on a different worksheet?
In the VBA editor, replace "Day Template" in ThisWorkbook.Worksheets("Day Template") with the exact name of the source worksheet. Change Range("A4:E13") if the template occupies a different range.
How do I keep the macro when saving the workbook?
Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). A standard XLSX workbook cannot retain VBA macros.




