+ Reply to Thread
Results 1 to 3 of 3

Cell interior color changer function

  1. #1
    Registered User
    Join Date
    12-24-2014
    Location
    Budapest, Hungary
    MS-Off Ver
    2013
    Posts
    7

    Cell interior color changer function

    Hi again, this little function's goal would be to check the cells in the selected range, and if there's a 0 there, change the color of the cell's - where the user wrote the function - color to green. I get #VALUE! when I run it, but if I comment out the actual "Cells(row, column).Interior.Color = vbGreen" line, it works fine, but obviously not changing the cell's color. Here's the code:

    Please Login or Register  to view this content.
    Thanks for your help.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Cell interior color changer function

    hi randomdude, function is supposed to return value or array of values, it can not change color

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,975

    Re: Cell interior color changer function

    Why don't you just use Conditional Formatting?

    Or, you could use a Custom Format to hide zeroes.

    Or, you could use a worksheet change event handler to monitor the cells and change the colour.

    Just not a User Defined Function used as a worksheet function.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Find a duplicate and then use the duplicates interior.color to change cell color.
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2012, 03:54 PM
  2. MAcro color changer
    By gotaget in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-26-2006, 03:01 PM
  3. Cell background color (interior color) setting not working
    By Martin E. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-21-2006, 02:10 PM
  4. Need Excel Formula/Function to color cell interior
    By akaster in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-19-2006, 01:35 PM
  5. interior color of a cell
    By R.VENKATARAMAN in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-11-2005, 01:10 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