+ Reply to Thread
Results 1 to 8 of 8

Highlight cell with Fill & Font Colour

Hybrid View

  1. #1
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Highlight cell with Fill & Font Colour

    nuraisyah,

    Do you need to loop?
    No loop and conditional format.
    Sub tst()
        Dim lastrow As Long, erow As Long
        With Sheets("PO Summary")
            lastrow = .Cells(Rows.Count, 2).End(xlUp).Row
            erow = 4
            With .Range("h" & erow & ":h" & lastrow)
                .FormatConditions.Delete
                .Offset(, 1).Formula = "=(f" & erow & "-g" & erow & ")/f" & erow
                .Formula = "=if(g4<=0,""Insufficient"",""Sufficient"")"
                .FormatConditions.Add Type:=xlExpression, Formula1:="=h" & erow & "=""Insufficient"""
                .FormatConditions(1).Font.Bold = True
                .FormatConditions(1).Font.Color = vbYellow
                .FormatConditions(1).Interior.Color = vbRed
            End With
        End With
    End Sub
    Last edited by jindon; 04-27-2016 at 12:14 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Font/Cell fill colour issues
    By eBopBob in forum Excel General
    Replies: 1
    Last Post: 03-30-2014, 10:21 AM
  2. Replies: 1
    Last Post: 09-12-2013, 02:09 PM
  3. Copy font/colour/fill of cells from one sheet into another.
    By stacesil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2013, 07:59 PM
  4. Replies: 6
    Last Post: 03-22-2012, 06:29 AM
  5. Command Buttons for Fill Colour and Font Colour
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-14-2011, 07:11 AM
  6. Multiple Fill Color & Font Colour icons on menu bar
    By robertguy in forum Excel General
    Replies: 3
    Last Post: 02-05-2008, 10:46 AM
  7. Criteria - Automatic Change Font or Fill Colour
    By stevembe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-04-2005, 12:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1