Conditional Formatting multiple tables the same way - VBA

choop

New Member
Joined
Oct 21, 2005
Messages
21
Hello,

I have a spreadsheet with about 7 identical (same headings, columns) tables. Those 7 tables are lists of employees for each of our seven plants. In addition to employee names, it includes a bunch of detail about job, manager, etc.

I have about 8 or 10 conditional formattings that I would like to use, but i'm finding that Excel gets very confused when I copy and paste data between tabs, or add new rows.

I would like to have a macro that can cycle through each of the tabs, clear all conditional formatting, and then re-apply my pre-defined conditional formatting. The trick is that the number of rows isn't the same between the tables, so ranges aren't a good option, the code would really need to apply to the table.Column itself so it dynamically incorporates all data, while leaving blank rows as regular formatting.

Tables:
Plant1​
Plant2​
etc...​

Columns include:
Site​
Baseline Employee​
EE Number​
SEGMENT​
Role Origination Date​
IN WORKDAY?​
Manager Name​
Shift​
Workday Title​
Simplifed Business Title​
Title-Shift​
B/V/SGA​
Comment​
January​
February​
March​
April​
May​
June​
July​
August​
September​
October​
November​
December​

Is this possible?

thanks
 
To get the whole table you can use
VBA Code:
With ws.ListObjects(1)
   .Range.FormatConditions.Delete
   Sheet22.ListObjects(1).DataBodyRange.Copy
   .DataBodyRange.PasteSpecial xlPasteFormats
End With
But if you have CF rules, outside this range, they may still exists.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

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