copy and paste special

bonovox1

Board Regular
Joined
Aug 11, 2007
Messages
91
hi i have a macro that i run after i run this macro i have to copy and paste the 3 sheets of my file. Could somebody suggest code that could do this in the macro itself.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Which sheets do you want to copy and where do you want to paste them?
 
Upvote 0
After i run the macro i copy and paste special values on all 3 sheets in the file. Simply i want to copy and paste special values on each sheet using vba code instead of having to do it manually after the macro has run.
 
Upvote 0
Try this:
Code:
Dim wb As Workbook
Dim sh As Worksheet
Set wb = ThisWorkbook
For Each sh In wb.Worksheets
    sh.UsedRange.Value = sh.UsedRange.Value
Next sh
 
Upvote 0
hi, i tried this but the macro runs perfectly but it doesn`t copy and paste special values at the end. Any ideas?
 
Upvote 0
Just to make sure it’s definitely running the code, try this:
Code:
Dim wb As Workbook
Dim sh As Worksheet
Set wb = ThisWorkbook
For Each sh In wb.Worksheets
    MsgBox sh.Name
    sh.UsedRange.Value = sh.UsedRange.Value
Next sh

You should get a box pop up with the name of each sheet as it does the conversion.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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