+ Reply to Thread
Results 1 to 2 of 2

Thread: Controlling Fill Colour in Macro

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    Newcastle
    MS-Off Ver
    Excel 2007
    Posts
    22

    Controlling Fill Colour in Macro

    Morning everyone,

    I am trying to set up a macro which searches for a particular text string and colours the cell in when this text string is found.

    At the moment, I have got the macro to search for the cell and currently it colours the cell in Green.

    I now want to develop the macro so when I fill in Cell B2 in a colour I want by using the fill function in Excel, the macro when run, determines what colour this is and fills all cells that contain the predefined text string in, with this colour.

    At the moment, in the macro, the colour is defined as follows:

    With Selection.FormatConditions(1).Interior
    .PatternColorIndex = xlAutomatic
    .Color = 5296274
    .TintAndShade = 0
    End With

    Many thanks!

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Controlling Fill Colour in Macro

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ 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.2.0