Arie Bos
Board Regular
- Joined
- Mar 25, 2016
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
The code below only copies a worksheet. Reason to use it that with manual copying, excel keeps asking for each range or cell name to accept it. With 50 or so names this means a lot of clicks. The last line in the macro avoids this.
The macro is a bit clumsy as i had to fill in the sheet to be copied ("18_04", last month) and the next month ("18_05"), but that fine. This simple code always worked well, but suddenly it halts on line 3.
(I know that clicking 50 time on the Yes botton takes less time than writing this new post, but hey, we all try to learn
Thanks,
Arie
The macro is a bit clumsy as i had to fill in the sheet to be copied ("18_04", last month) and the next month ("18_05"), but that fine. This simple code always worked well, but suddenly it halts on line 3.
(I know that clicking 50 time on the Yes botton takes less time than writing this new post, but hey, we all try to learn
Thanks,
Arie
Code:
Sub CopyMonth()
Application.DisplayAlerts = False
ActiveWorbook.Sheets("18_04").Copy after:=Sheets("18_04")
'rename the copied sheet by putting the desired name in the next line
ActiveSheet.Name = "18_05"
Application.DisplayAlerts = True
End Sub