Results 1 to 5 of 5

ColorIndex with VBA in column until text is found

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-16-2009
    Location
    Ill.
    MS-Off Ver
    Excel 2010
    Posts
    190

    ColorIndex with VBA in column until text is found

    Hello - I'm working with the code below. I'm trying to color column A blue, from a2 to a40. However I don't want to go all the way down to row 40, I want to stop where text Grand Total~ is found in Column B, in my case now thats B30...

    I think I"m close, but need something in my loop statement that will stop at the point.

    Sub Bluecolor()
    Dim cE As Range
        Dim SrchRngE    
    
        Set SrchRngE = ActiveSheet.Range("A2", ActiveSheet.Range("A65536").End(xlUp))
        
        Do
            Set cE = Range("a2:a40") 'SrchRngE.Find("Call Center", LookIn:=xlValues)
            
            If Not cE Is Nothing Then cE.Interior.ColorIndex = 37 
        Loop While Not cE.Offset(0, 1) = "Grand Total~"
    
    End Sub
    Thanks for taking a look...
    Last edited by Ironman; 03-18-2011 at 03:19 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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