Copy sheet within same workbook minus shapes

Livin404

Well-known Member
Joined
Jan 7, 2019
Messages
743
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello my macro works properly, I am hoping there is something I can do to not have the two shapes I use "GET PHT" and "CLEAR" (lanuch Macros) are left off the new worksheet I have created with the macro below.

Thank you very much!

VBA Code:
Sub Copy_SURFACE_PHT()
Set ws = Sheets("PHT")
 
ws.Copy After:=Sheets("PHT AIR")
 
Set wsNew = Sheets(Sheets("PHT AIR").Index + 1)
 
wsNew.Name = "PHT SURFACE"
End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
How about:

VBA Code:
Sub Copy_SURFACE_PHT()
'
    Application.ScreenUpdating = False
    Application.CopyObjectsWithCells = False
'
    Set ws = Sheets("PHT")
    ws.Copy After:=Sheets("PHT AIR")
'
    Sheets(Sheets("PHT AIR").Index + 1).Name = "PHT SURFACE"
'
    Application.CopyObjectsWithCells = True
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
How about:

VBA Code:
Sub Copy_SURFACE_PHT()
'
    Application.ScreenUpdating = False
    Application.CopyObjectsWithCells = False
'
    Set ws = Sheets("PHT")
    ws.Copy After:=Sheets("PHT AIR")
'
    Sheets(Sheets("PHT AIR").Index + 1).Name = "PHT SURFACE"
'
    Application.CopyObjectsWithCells = True
    Application.ScreenUpdating = True
End Sub
That is beautiful- Thank you,
 
Upvote 0

Forum statistics

Threads
1,215,294
Messages
6,124,100
Members
449,142
Latest member
championbowler

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top