PankajMaheshwari
New Member
- Joined
- Sep 7, 2020
- Messages
- 26
- Office Version
- 365
- Platform
- Windows
- MacOS
- Mobile
Hi Experts,
I have a file in which the first sheet is my Template sheet and remaining other sheets have similar template but has data in it. What I'm trying to achieve here is whenever someone creates a new sheet, it doesn't just create a blank sheet, but it creates the standard template which is my first sheet in the file.
I was trying to trigger a new/insert sheet event and then it goes to the first tab, copy it and then comes back to the new sheet and paste entire template. But I failed.
So my questions are 1. Can someone help me in modifying my below code. 2. Is there a better way of doing this?
Thanks in advance for any support. You guys have been wonderful so far.
I have a file in which the first sheet is my Template sheet and remaining other sheets have similar template but has data in it. What I'm trying to achieve here is whenever someone creates a new sheet, it doesn't just create a blank sheet, but it creates the standard template which is my first sheet in the file.
I was trying to trigger a new/insert sheet event and then it goes to the first tab, copy it and then comes back to the new sheet and paste entire template. But I failed.
So my questions are 1. Can someone help me in modifying my below code. 2. Is there a better way of doing this?
VBA Code:
Private Sub Workbook_NewSheet(ByVal Sh As Object)
Sheets("Template").Select
Cells.Select
Selection.Copy
Sheets("Sh").Select
Range("A1").Select
ActiveSheet.Paste
Range("A1").Select
ActiveWindow.DisplayGridlines = False
ActiveWindow.Zoom = 90
End Sub
Thanks in advance for any support. You guys have been wonderful so far.