ether
New Member
- Joined
- Sep 4, 2021
- Messages
- 4
- Office Version
- 2019
- 2016
- Platform
- Windows
- MacOS
- Mobile
- Web
I created a Marco to copy a worksheet named "Data" to a new worksheet called "Sept"
Then unmerged all the cells in "Sept", and copied it to a new worksheet named "Oct"
The problem I'm running into is that it only works on new workbooks.
If I use it on a workbook with data already in it, when I get here: Worksheets("Sept").Copy After:=Worksheets("Sept")
It says the 'Click_to_Select_Amount' already exist.
I don't have another worksheet named Oct, so I'm not sure what's going on.
Any ideas?
Then unmerged all the cells in "Sept", and copied it to a new worksheet named "Oct"
The problem I'm running into is that it only works on new workbooks.
If I use it on a workbook with data already in it, when I get here: Worksheets("Sept").Copy After:=Worksheets("Sept")
It says the 'Click_to_Select_Amount' already exist.
I don't have another worksheet named Oct, so I'm not sure what's going on.
Any ideas?
VBA Code:
Sub Copy()
'
Set ws = ActiveSheet
ActiveSheet.Name = "Data"
ws.Copy After:=Worksheets(Sheets.Count)
ActiveSheet.Name = "Sept"
ActiveSheet.Cells.UnMerge
Worksheets("Sept").Copy After:=Worksheets("Sept")
'
End Sub