Multiple Sheet Conditional Formatting With VBA

colinh

Board Regular
Joined
Dec 2, 2010
Messages
60
Hello All,

I was wondering if I could get some help on conditional formatting of my workbook?

I have in my workbook a tab called - START - then I have lots of tabs after (100 plus) and they are all the same template wise but obviously have different data in them. I then have a tab at the end called -END -.

So all the tabs between -START - and - END - the cells I13 to I29 need to be conditional formatted to white text if the value is less than or equal to 0.

I am working on the basis if I remove tabs or copy tabs the formatting will be carried onwards as long as they are in between the start & end named tabs. This will also help as I don't want to have to format the 100 plus tabs I already have individually.

Many thanks for you help.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
hi colinh,
try the below in a standard module

VBA Code:
Private Sub h()
Dim wk As Worksheet
  For Each wk In ThisWorkbook.Worksheets
    If wk.Name <> "Start" And wk.Name <> "End" Then
        For i = 13 To 29
            If Cells(i, 9) <= 0 Then
                Cells(i, 9).Font.Color = vbWhite
            End If
        Next i
    End If
  Next wk
End Sub

since it is concerns more than 100 sheets, I would suggest making a copy of your workbook and then executing the code above, just to be on the safer side.

HTH...
 
Upvote 0

Forum statistics

Threads
1,215,501
Messages
6,125,169
Members
449,212
Latest member
kenmaldonado

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