+ Reply to Thread
Results 1 to 4 of 4

Formatting Macro

  1. #1
    Registered User
    Join Date
    09-27-2009
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    23

    Formatting Macro

    Here's what I want to do...

    I have a column of cells:

    ODD
    EVEN
    ODD
    EVEN
    ODD
    EVEN

    etc...

    I'm trying to create a macro that will test each cell in this colum...if the cell equals 'ODD' it will turn a range of cells in the same row a different color. It will do nothing if the cell doesn't equal 'ODD'.

    Been having a devil of a time trying to get a FOR loop going, and any IF statement I come up with just isn't cutting it for anything more than one row.

    Thanks is advance!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting Macro Question

    No need for a macro if this is all you're trying to do. This is what conditional formatting is for. If the ODD/EVEN cells were in column A:

    1) Highlight all the columns you want to behave this way
    2) Click on Format > Conditional Formatting
    3) Condition1 > Formula Is: =A1="ODD"
    4) Select Format... Patterns tab: color of choice
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-27-2009
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Formatting Macro Question

    Quote Originally Posted by JBeaucaire View Post
    No need for a macro if this is all you're trying to do. This is what conditional formatting is for. If the ODD/EVEN cells were in column A:

    1) Highlight all the columns you want to behave this way
    2) Click on Format > Conditional Formatting
    3) Condition1 > Formula Is: =A1="ODD"
    4) Select Format... Patterns tab: color of choice
    I may have Excel record those actions into a macro for me. The sheet I'm creating is for my employees and I want to make it as painless as possible for them whenever they make a change that requires reformatting line colors.

    Thanks! This information will get the job done!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formatting Macro Question

    Just to be clear, if you've never used conditional formatting before, this isn't something I'm suggesting you teach them how to do. THis is something you install into all those columns NOW and then the appropriate cell has "ODD" in it, the other cells in that row change color on their own.

    ========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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