Speed

G

Guest

Hello,

I use several Do Loops or For Next loops with If statements within my
macros. In most cases it will look through 2K rows before quitting. One
example is the one below, which hides rows based on certain color
requirements. The ColorIndex statement is referencing another function for
the certain color. Is there a faster method to loop through data, such as
this? Many of my macros have gotten very slow.

Range("b8").Select
Do
If ActiveCell.Font.ColorIndex = -4105 Then
If ActiveCell.Value = "" And ActiveCell.Offset(-1, 0).Font.Bold = True
Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
End If
Else
If ActiveCell.Font.Bold = True Then
Else
ActiveCell.Offset(0, 14).Value = Round(((Cells(ActiveCell.row,
15).Value) / 1000000), 1)
End If
ActiveCell.Offset(1, 0).Select
End If

Loop Until ActiveCell.Value = "" And ActiveCell.Offset(-1, 0).Value = "" And
ActiveCell.Offset(-2, 0).Value = "" And ActiveCell.Offset(-3, 0).Value = ""
And ActiveCell.Offset(-4, 0).Value = "" And ActiveCell.Offset(-5, 0).Value =
""
 
G

Guest

You posted this question on 11/18/2004 and it appears as though no one
responded to your inquiry. If you are still attempting to solve the problem
of "Speed", then re-post your question in this NewsGroup and one of us will
take a fresh look at it. On your original posting, you should click the YES
or NO buttons to close out that entry on the system.

Steve in Ohio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top