+ Reply to Thread
Results 1 to 6 of 6

Changing cell color using VBA

  1. #1
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Changing cell color using VBA

    Hi, I am trying to change the cell color using VBA programming and I keep receiving an error for my code. The error I get is "object doesn't support this method"

    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Changing cell color using VBA

    Remove the asterisk from the first Value property.

  3. #3
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Changing cell color using VBA

    Sill mistake on my end thank you.

    Do you know how I could make that a loop so it continues down the page reading all the cells? Like next it will it for R3 & Q3 then R4 & Q4, etc?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Changing cell color using VBA

    How far do you want it to go, and is there a reason to not just use conditional formatting for this?

  5. #5
    Registered User
    Join Date
    06-28-2018
    Location
    US
    MS-Off Ver
    2016
    Posts
    89

    Re: Changing cell color using VBA

    It would have to go pretty far down, like a couple thousand rows. It can't be conditional formatting because I am using a command button so I can like click on the button then the code will run and the cells will highlight.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,998

    Re: Changing cell color using VBA

    This would go to the last value in column Q:

    Please Login or Register  to view this content.
    Last edited by romperstomper; 07-16-2018 at 09:53 AM.

+ 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. Any way to apply a color theme by changing the color of one cell ?
    By KomicJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-02-2016, 01:11 PM
  2. Replies: 3
    Last Post: 08-18-2014, 12:47 PM
  3. [SOLVED] Changing fill color of shapes based on changing cell value
    By Stefan1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2012, 10:33 AM
  4. Changing a cell's color based on it's color and the value of another cell
    By lorr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2012, 01:09 PM
  5. changing cell color based on changing values
    By tvonbehren in forum Excel General
    Replies: 2
    Last Post: 09-16-2009, 12:33 PM
  6. Changing Cell color?
    By xmux in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2009, 06:14 AM
  7. Cell color changing
    By jjohnson3333 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-30-2006, 06:11 PM

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.6.0 RC 1