+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting with Macro

  1. #1
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Conditional Formatting with Macro

    Hi,
    l want to do conditional formatting rule with macro for multiple sequences.
    Example
    Please Login or Register  to view this content.
    If "S25" is equal to "0" or blank cells; C25: N47 in the block, text and background (fill) "white" color, borders the "No" I want to do.
    If "S25" is not equal to "0" or full, C25: N47 in the block will return back.

    I tried to write the code but did not.
    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.

    Sorry my bad English.
    Thanks for your helping.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Conditional Formatting with Macro

    Try this...

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 04-15-2014 at 10:23 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Conditional Formatting with Macro

    Hi, AlphaFrog
    Code is working properly. There is only one mistake.
    This Code:
    Formula1:="=$S$" & i + 25 & "=0"

    "S26" and the others working good but "S25" is not working properly for i=1 to 99.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Conditional Formatting with Macro

    I don't understand what that means?

  5. #5
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Conditional Formatting with Macro

    Please Login or Register  to view this content.
    When l enter a value in "S25", it is not working. But the other "S26,S27,S28......" is working properly. (May be "i" starting from 1 in this code (Formula1:="=$S$" & i + 25 & "=0").)

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Conditional Formatting with Macro

    Quote Originally Posted by ofd2008 View Post
    Please Login or Register  to view this content.
    When l enter a value in "S25", it is not working. But the other "S26,S27,S28......" is working properly. (May be "i" starting from 1 in this code (Formula1:="=$S$" & i + 25 & "=0").)
    Entering any value in S25 works for me on your example file. Perhaps you put a space character in S25 ?

    Look at the conditional format (CF) formula for any cell in C25:N47, it should be =$S$25=0

    The With-End With code block sets all the CF formulas to S25 and the format for the entire range C25:N2324. The For-Next loop then just modifies the CF formulas for the ranges below C25:N47.

  7. #7
    Registered User
    Join Date
    02-25-2014
    Location
    Turkey
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Conditional Formatting with Macro

    Hi, AlphaFrog
    The problem was solved.

    Working Code:
    Please Login or Register  to view this content.
    And The other macro with commandclick button. (*** I could not do macro when button pressed with the above code. Therefore a long macro appeared.)

    Please Login or Register  to view this content.

+ 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. [SOLVED] Conditional Formatting or Macro?
    By aaw in forum Excel General
    Replies: 3
    Last Post: 03-27-2012, 06:04 PM
  2. Macro for formatting fonts and cell colours - not Conditional Formatting
    By Kayaness in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2011, 03:46 AM
  3. Macro/Conditional Formatting help
    By denise6372 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2009, 06:06 AM
  4. Conditional formatting using a macro.
    By Jay3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2008, 08:09 PM
  5. Conditional formatting Macro
    By Stėophan in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-13-2007, 05:24 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