Results 1 to 9 of 9

VBA for comparing Columns

Threaded View

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    VBA for comparing Columns

    This macro is supposed to look down column B and see if the value in each cell is greater than the value to the right(in column C). If so, it should color the cell. But it doesn't work!!! Help

    Sub Man_Whydoesntthiswork()
    
    Dim count As Integer
    Dim i As Integer
    
    For i = 1 To 100
    
    count = 2
    
    If Cells(count, 2) > Cells(count, 3) Then
    Cells(count, 2).Interior.Color = 5
    End If
    
    count = count + 1
    
    Next i
    
    End Sub
    Last edited by vlady; 12-04-2012 at 08:53 PM. Reason: code tags

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