VBA to remove conditional formatting and past values

mountainman88

Board Regular
Joined
Jun 22, 2019
Messages
109
Office Version
  1. 2016
Platform
  1. Windows
Im looking for 4 separate pieces of VBA please

  1. cycle through every tab in a workbook and remove all conditional formatting
  2. cycle through every tab in a workbook and paste values entire tab
  3. cycle through tabs in a workbook but only those on a list of tabs in a tab called 'listCF' and remove conditional formatting
  4. cycle through tabs in a workbook but only those on a list of tabs in a tab called 'listPV' and remove conditional formatting and paste values entire tab
many thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hello,

Part 1

VBA Code:
Sub FormatinGone()
Dim ws As Worksheet
    For Each ws In Worksheets
    ws.Cells.FormatConditions.Delete
    Next ws
End Sub


I don't know what - and paste values entire tab - means.

The above code should get you started.

Jamie
 
Upvote 0
Hello,

Part 1

VBA Code:
Sub FormatinGone()
Dim ws As Worksheet
    For Each ws In Worksheets
    ws.Cells.FormatConditions.Delete
    Next ws
End Sub


I don't know what - and paste values entire tab - means.

The above code should get you started.

Jamie
literally select all, copy the tab and then paste values back onto the tab removing all formulas. Do this for each tab. Thanks
 
Upvote 0
Hello,

This will copy and paste the values from A1:L21. Change the selection area to the largest you have.


VBA Code:
Sub CopyAll()
Dim ws As Worksheet
    Application.ScreenUpdating = False
    For Each ws In Worksheets
    ws.Select
    Cells.Range("A1:L21").Copy 
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Next ws
    Application.ScreenUpdating = True
End Sub

Jamie
 
Upvote 0
Another option
VBA Code:
Sub mountainman()
   Dim Ws As Worksheet
   
   For Each Ws In Worksheets
      With Ws.UsedRange
         .FormatConditions.Delete
         .Value = .Value
      End With
   Next Ws
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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