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.
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.
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.
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.