Results 1 to 4 of 4

help on a Do loop that doesn't work

Threaded View

g_liron help on a Do loop that... 01-12-2015, 10:42 AM
Richard Buttrey Re: help on a Do loop that... 01-12-2015, 10:45 AM
romperstomper Re: help on a Do loop that... 01-12-2015, 10:50 AM
g_liron Re: help on a Do loop that... 01-12-2015, 10:50 AM
  1. #1
    Registered User
    Join Date
    01-12-2015
    Location
    Israel
    MS-Off Ver
    2007
    Posts
    2

    help on a Do loop that doesn't work

    I have big data file on excel, the file has 6930 rows and 8 columns, the 8 column has percents (0%, 4%, 16%, 18%, 19% and etc..)
    I tried to do a macro that paint all the rows that the percent in the end of their row are bigger then 18%, and it doesn't work,
    I would like to get some ideas how to make it work, Thanks in advance.

    The file start from row 3, so rows 1 and 2 are empty The macro:

    Sub Test_4
    
    Dim i As Long
    
    Dim countErr As Long
    
    countErr = 0
    
    i = 2
    
    Do While Cells(i, 1) = ""
    
    If Cells(i, 8).Value > 0.18 And IsNumeric(Cells(i, 8)) Then
    
    Range(Cells(i, 1), Cells(i, 8)).Interior.ColorIndex = 3
    
    countErr = countErr + 1
    End If
    
    i = i + 1
    Loop
    
    If countErr > 0 Then
    
    Sheets("test").Select
    
    Range("E8").Select
    
    Selection.Interior.ColorIndex = 3
    
    Range("D8").Select
    
          Selection.FormulaR1C1 = countErr
    Else
    
    Sheets("test").Select
    
    Range("E8").Select
    
    Selection.Interior.ColorIndex = 4
    
    Sheets("test").Range("d8") = "0"
    
    End If
    End Sub
    Last edited by g_liron; 01-12-2015 at 10:50 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Loop to find, copy and paste data doesn't work
    By mazerinth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2012, 09:07 AM
  2. UDF Doesn't work with top level Do While-Loop
    By indium in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-02-2012, 01:17 PM
  3. Macro Loop Broken. Detects Max but doesn't continue loop
    By herchenbach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2011, 12:17 PM
  4. My loop doesn't work why not
    By ljh66 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-06-2007, 01:02 PM
  5. For Each - loop doesn't work.
    By Intellihome in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2005, 07:05 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