Skip Charts While Copying and Pasting Values a Whole Workbook

easyquestions

New Member
Joined
Sep 2, 2011
Messages
2
I'm trying to find VBA codes that will copy-paste values a whole workbook (w/many many tabs) but skip charts. The codes below are the one that I'm using to copy-paste special values for a whole workbook. But I have a few charts included this time, and wouldn't work unless I manually change the sheet count#. Please help!

Sub MakeDeliverable()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
Application.ScreenUpdating = False<o:p></o:p>
<o:p> </o:p>
Dim i<o:p></o:p>
For i = 1 To Sheets.Count<o:p></o:p>
<o:p> </o:p>
Sheets(i).Visible = True<o:p></o:p>
Sheets(i).Select<o:p></o:p>
With Selection<o:p></o:p>
.Copy<o:p></o:p>
.PasteSpecial Paste:=xlPasteValues<o:p></o:p>
End With<o:p></o:p>
Range("A1").Select<o:p></o:p>
<o:p> </o:p>
Next i<o:p></o:p>
<o:p> </o:p>
Sheets(1).Select<o:p></o:p>
<o:p> </o:p>
Application.ScreenUpdating = True<o:p></o:p>
<o:p> </o:p>
End Sub<o:p></o:p>
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Set the Chart Properties to "Don't move or size with cells".

To do this:
On the Chart Tools > Format tab > Size group, click the little symbol to the right of the group label ("Size"). This opens up a familiar dialog, and what you want is on the Properties tab.
You will have to do this for each Chart.
 
Upvote 0
In addition to John's suggestion, if you want your code to skip over Sheets that are Charts (as opposed to Charts on Worksheets), you can replace references to "Sheets" in your code with "Worksheets".
 
Upvote 0
Thank you so much, you guys!

Jerry, that worked like a magic; I had sheets that are charts in my workbook like you said. Perfect! Thanks again!
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,220
Members
452,895
Latest member
BILLING GUY

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