Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6863465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:47:09+00:00 2026-05-27T02:47:09+00:00

I have some (semi) complex conditional formatting to do in Excel. I can get

  • 0

I have some (semi) complex conditional formatting to do in Excel. I can get it working no problem using the menu, but I want to do it programmatically because I want it applied across multiple sheets (copy, paste as format does not work).

I tried recording a macro while I set up the CF to get the code, but it doesn’t record that type of entry.

Here are the rules I’m applying, currently to the range: =$1:$65536

=OR(COLUMN()=1,COLUMN()=2,ISBLANK($B1))
=AND(LEFT($A1,6)="Base (",A1>100)
=AND(LEFT($A1,6)="Base (",A1>=75,A1<=100)
=AND(LEFT($A1,6)="Base (",A1>=50,A1<75)
=AND(LEFT($A1,6)="Base (",A1<50)
=$B1-9.999  (current cell is less than this value)

Like I said, I can copy this manually by copying a whole column from one sheet to the next, but I can’t copy it across all sheets, and I’d like to find a way to do it as a Macro so it can easily be applied to new workbooks (which tend to have 10-15 sheets).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:47:10+00:00Added an answer on May 27, 2026 at 2:47 am
    Sub DoCFRules()
    
        Dim rng As Range
        Set rng = ThisWorkbook.Sheets("Sheet1").Cells
    
        rng.Parent.Activate
        rng.Cells(1).Select 'Important!
    
        ApplyCF rng, "=OR(COLUMN()=1,COLUMN()=2,ISBLANK($B1))", RGB(0, 255, 0)
        ApplyCF rng, "=AND(LEFT(A1,6)=""Base ("",A1>100)", RGB(255, 0, 0)
        'etc...
    
    End Sub
    
    Sub ApplyCF(rng As Range, sFormula As String, clr As Long)
        With rng.FormatConditions.Add(Type:=xlExpression, Formula1:=sFormula)
            .Interior.Color = clr
        End With
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Excel 2010 and trying to work on some semi-complicated conditional formatting. The spreadsheet
I want to have some text appear semi-transparent, but not in an overlay fashion
I'm trying to get my head around using QuartzCore to render semi-complex text/gradient/image UITableViewCell
I have a semi-working example that you can look at. This appears to work
I have some UI in VB 2005 that looks great in XP Style, but
I have some kind of test data and want to create a unit test
We have some files on our website that users of our software can download.
I have the following code (this is some semi-sudo code, which may not compile):
Sorry for the semi-rant here. I am hooked on javascript and want some direction
I have to work with some (semi-)automatical verification software (CBMC (link) ) which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.