OzGrid

How to copy the entire sheet and paste as values - Running on multiple tabs

< Back to Search results

 Category: [Excel]  Demo Available 

How to copy the entire sheet and paste as values - Running on multiple tabs

 

Requirement:

 

The user is trying to copy the entire sheet and paste as values ( to kill all the formulas and SQL links) but the user needs this macro to run on all or most of the tabs in the workbook.

Below is the current Macro:

Click image for larger version

Name:	Macro 1.png
Views:	0
Size:	56.4 KB
ID:	1214052https://www.ozgrid.com/forum/forum/help-forums/excel-vba-macros/1214051-copy-the-entire-sheet-and-paste-as-values-running-on-multiple-tabs

 

Solution:

 

Code:
Sub Test()
    Dim ws As Worksheet

    Application.ScreenUpdating = 0
    For Each ws In Sheets
        With ws.UsedRange
            .Value = .Value
        End With
    Next

End Sub

 

Obtained from the OzGrid Help Forum.

Solution provided by KjBox.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to create repeated cell values
How to use a macro to run through sheet in excel and put double quotes around values
How to Auto populate cells with existing values
How to use VBA code to transpose any copy values X number of times
How to hide rows based on 2 value

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.


Gallery



stars (0 Reviews)