saloelrn1988
New Member
- Joined
- Apr 14, 2020
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Help!
I tried a macro to copy my sheet and rename it base on code of the country that I am working on, however when I run the macro the source data of the pivot table in the new tab still is from the old tab, I wanted to move the source data of my pivot table base on the new table that I created. I used below codes to create a copy of the original tab.
Sub Copy_Sheet()
Sheets("template").Copy After:=Sheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = Range("A2").Value
On Error GoTo 0
Sheets("template").Select
End Sub
Please help me
I tried a macro to copy my sheet and rename it base on code of the country that I am working on, however when I run the macro the source data of the pivot table in the new tab still is from the old tab, I wanted to move the source data of my pivot table base on the new table that I created. I used below codes to create a copy of the original tab.
Sub Copy_Sheet()
Sheets("template").Copy After:=Sheets(Sheets.Count)
On Error Resume Next
ActiveSheet.Name = Range("A2").Value
On Error GoTo 0
Sheets("template").Select
End Sub
Please help me