+ Reply to Thread
Results 1 to 1 of 1

VBA conditional formatting variables

Hybrid View

  1. #1
    Registered User
    Join Date
    12-01-2012
    Location
    los angeles
    MS-Off Ver
    Excel 2007
    Posts
    1

    VBA conditional formatting variables

    Hi.... this is my first post, ever, but thanks in advance to all.... great forum, with lots of really sharp people!

    the below rutine works fine, but I'd like to request the user to supply the threshold value (and, i would validate their input)

    Can anyone show me how to pass the value from inputbox so i can replace the hardcoded 0.1 below. I've tried:

    "=AND(ISERROR(SEARCH(""Total"",C3)),OR("I3<=-" & MyValue,"I3>=" & MyValue))" but without success THANKS!


    ' add conditional formatting for $100K threshold
        Range("I3").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
            "=AND(ISERROR(SEARCH(""Total"",C3)),OR(I3<=-0.1,I3>=0.1))"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .Color = 65535
            .TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
    Last edited by jeffreybrown; 12-01-2012 at 10:23 PM. Reason: Code tags are required...Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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