Copy - paste special values only

Pedro Morais

Board Regular
Joined
Dec 5, 2007
Messages
90
Hey guys,

I'm looking for sum code to select all sheets in a workbook, copy all cells and paste values only.
Can anyone help me with that?

Cheers
Pedro
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Thanks for the answer, probably i didnt explain myself too well...

the number and name of sheets will vary... over 60...
so i need a formula that selects all sheets instead of going selecting one by one.
I dont know how to do that in excel or the code to do it in vba.

Cheers
 
Upvote 0
Rich (BB code):
Dim ws As Worksheet


For Each ws In Sheets


    If ws.Visible Then ws.Select (False)


Next
Credits to NateO

Edit this to fit your needs:
Rich (BB code):
    Cells.Select
    Selection.Copy
    Workbookname here.Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("E11").Select
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,816
Members
449,049
Latest member
cybersurfer5000

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