Results 1 to 4 of 4
  1. #1
    Johnny12 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    31

    Interior.Color question

    Have a report exporting to excel. I use the NumberFormat line to change the font color if the number is a positive number. I'd like to change the interior color of the same cell. So in the end, if the number is a positive, the number should be red and the cell yellow.




    Code:
    ** Used for font color, this works fine
    
    .Columns("AG").NumberFormat = "[RED]###;-###;0"
    
    
    ** What I'm trying for the interior color that does not work
    
    .Columns("AG").Interior.Color = "[YELLOW]###;-###;0"

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You cannot put a number format condition in the ".Interior.Color" property. It doesn't make sense, and is not allowed.
    A different way to approach that part is to put Conditional Formatting on that column, to set the yello Interior Color property.

  3. #3
    Johnny12 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    31
    Thank you. Considered this solved.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 07-01-2020, 03:29 AM
  2. Replies: 3
    Last Post: 02-23-2019, 06:10 PM
  3. Change Text color and/or background color
    By Thompyt in forum Reports
    Replies: 2
    Last Post: 02-23-2017, 07:08 PM
  4. change tab color or header color
    By witz07 in forum Access
    Replies: 6
    Last Post: 03-31-2016, 05:31 PM
  5. How do I add color a tab on a forms tab?
    By aquabp in forum Forms
    Replies: 3
    Last Post: 12-16-2015, 02:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums