willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 888
- Office Version
- 365
- Platform
- Windows
Hello,
I have a Macro that makes a copy of the current sheet I am on, however every time it does it breaks 2 of my Form Control Buttons on the Sheet that are linked to Macros.
Is there any way to prevent this?
Thank you to anyone who can help
I have a Macro that makes a copy of the current sheet I am on, however every time it does it breaks 2 of my Form Control Buttons on the Sheet that are linked to Macros.
Is there any way to prevent this?
VBA Code:
Sub VIEW_DD()
'
' VIEW_DD Macro
'
'
Application.DisplayAlerts = False
Application.CopyObjectsWithCells = False
Sheets("Demand Detail").Select
ActiveSheet.Buttons.Add(4.5, 3.75, 81.75, 36).Select
ActiveSheet.Buttons.Add(90.75, 3.75, 62.25, 36).Select
ActiveSheet.Shapes.Range(Array("Year 1")).Select
ActiveSheet.Shapes.Range(Array("Flag 1")).Select
ActiveSheet.Shapes.Range(Array("Flag without Date")).Select
ActiveSheet.Shapes.Range(Array("Order Type")).Select
ActiveSheet.Shapes.Range(Array("Column1")).Select
Sheets("Demand Detail").Copy
Windows("Master Forecast Inc.xlsm").Activate
Application.DisplayAlerts = True
Application.CopyObjectsWithCells = True
End Sub
Thank you to anyone who can help