Macro Continuation
Sorry again. I thought I fixed this line
from
LastRow = Range(Rows.count,"K").end(xlup).row
to
LastRow = cells(Rows.count,"K").end(xlup).row
"Beep Beep" wrote:
Joel, Thanks for your help however I keep getting the following error message
at the beginning LastRow = Range(Rows.count,"K").end(xlup).row
METHOD 'RANGE' OF OBJECT'_GLOBAL'FAILED
"Joel" wrote:
Sorry, this code is tested and works. Forgot to remove SELECTION from you
original code. Had to comment out x1solid. This format doesn't work on my
computer. It may work on yours.
"Joel" wrote:
Sub LessThan1000orBlank()
LastRow = Range(Rows.count,"K").end(xlup).row
RowCount = 1
Do while RowCount <= Lastrow
If cells(RowCount,"K") < 1000 Then
With Selection.Interior
.ColorIndex = 6
.Pattern = x1solid
End With
End If
RowCount = RowCount + 1
Loop
"Beep Beep" wrote:
The below macro works ok, however it neither color's the cell and also I
would like the macro to continue on after finding one cell with less than
1,000 or blank. Currently it stops at the first cell it finds with this
criteria. There could be multiple cells that fall under this criteria.
Sub LessThan1000orBlank()
Range("K1").Select
Do Until ActiveCell < 1000
If ActiveCell < 1000 Then
With Selection.Interior
.ColorIndex = 6
.Pattern = x1solid
End With
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub
|