Results 1 to 3 of 3

VBA debug - Creating conditional formats that cover a range

Threaded View

The_Snook VBA debug - Creating... 09-26-2016, 06:48 AM
xlnitwit Re: VBA debug - Creating... 09-26-2016, 07:10 AM
The_Snook Re: VBA debug - Creating... 09-26-2016, 09:26 AM
  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,015

    VBA debug - Creating conditional formats that cover a range

    Morning all,

    I've tweaked some existing code I have but I'm encountering an error message when I run it. I'm trying to apply a conditional format to a range (starting in cell AO2 and covering the range below and to the right of it). Below is the code I am using and the issue appears to arise around the line highlighted in red.

    Range("AO2").Select
    Range(Selection, Selection.End(xlDown).End(xlToRight)).Select
    
    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=cells(2,41).address(false, false)=TRUE"
    
        With Selection.FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorAccent6
            .TintAndShade = 0.799981688894314
            
        End With
    Thanks in advance,

    Snook
    Last edited by The_Snook; 09-26-2016 at 09:27 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 10-01-2014, 03:18 PM
  2. creating custom text cover letters using Excel
    By alonsogar in forum Excel General
    Replies: 2
    Last Post: 09-26-2014, 12:47 AM
  3. [SOLVED] PasteSpecial with number formats but without conditional formats or borders
    By bodhi808 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2013, 09:58 AM
  4. Replies: 6
    Last Post: 06-29-2013, 03:56 PM
  5. [SOLVED] Loop and apply conditional formats through a range row by row
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2012, 11:57 PM
  6. Creating extra Conditional Formats in VBA
    By ConfusedOldMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2010, 03:09 PM
  7. If statement to cover range
    By TheLeafs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2006, 11:30 AM

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