Results 1 to 10 of 10

Change pattern based on cell value (Multiple conditions)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Change pattern based on cell value (Multiple conditions)

    As per attached excel file, I want 4 pattern condition to run automatically when text inside cell C6 changed.

    http://www.excelforum.com/attachment...1&d=1462856509

    Code 1 have so far

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Sheets("TEST").Range("C6").Value = "Quarterly" Then
    Call Change_Pattern_Quarterly
    End If
    End Sub
    'Monthly
    'Bimonthly
    'Quarterly
    'Weekly
    Sub Change_Pattern_Monthly()
    If Range("C6").Value = "Monthly" Then
        With Range("E10:P32")
            With .Interior
                 .Pattern = xlPatternLightUp
            End With
        End With
    End If
    End Sub
    
    Sub Change_Pattern_Bimonthly()
    If Range("C6").Value = "Bimonthly" Then
        With Range("E10:P32,B12:D12,B16:D16,B20:D20,B24:D24,B28:D28,B32:D32")
            With .Interior
                 .Pattern = xlPatternLightUp
            End With
        End With
    End If
    End Sub
    
    Sub Change_Pattern_Quarterly()
    If Range("C6").Value = "Quarterly" Then
        With Range("E10:P32,B12:D20,B24:D32")
            With .Interior
                 .Pattern = xlPatternLightUp
            End With
        End With
    End If
    End Sub
    
    Sub Change_Pattern_Weekly()
    If Range("C6").Value = "Weekly" Then
        With Range("A10:P32")
            With .Interior
                 .Pattern = xlPatternNone
            End With
        End With
    End If
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Set Cell Value Based on Multiple Conditions
    By BurkinaFaso in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-11-2015, 01:14 AM
  2. Macro to insert pattern based on value and select based on pattern
    By CB569 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2015, 12:36 PM
  3. [SOLVED] Lookup and return rows based on pattern start and pattern end
    By JDI in forum Excel General
    Replies: 18
    Last Post: 11-16-2014, 11:44 PM
  4. Replies: 5
    Last Post: 04-28-2014, 07:54 AM
  5. Cell value based on multiple conditions
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-23-2010, 12:57 PM
  6. How do I change color pattern based upon a formula within a cell?
    By aemuk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2006, 06:25 PM
  7. [SOLVED] Cell values based upon multiple conditions
    By Ryan M via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-18-2005, 10:05 PM

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