Results 1 to 6 of 6

Changing cell color using VBA

Threaded View

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

    Re: Changing cell color using VBA

    This would go to the last value in column Q:

    Private Sub CommandButton1_Click()
    dim n as long
    dim data
    data = range("Q2:R" & cells(rows.count, "Q").end(xlup).row).value
    application.screenupating = false
    for n = 1 to ubound(data)
    If data(n, 2) > data(n, 1) Then Cells(n + 1, "A").Interior.ColorIndex = 3
    next
    End Sub
    Last edited by romperstomper; 07-16-2018 at 09:53 AM.

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