Glaswegian
07-08-2009, 04:00 AM
Hi
I've obviously left my brain at home today...:dunno
I'm filtering a list (about 2000 rows) using 3 criteria. This leaves me with a list of about 17-20 rows. I'm trying to colour the font in the first 10 rows in one column but this is where my brain has departed - I can colour all 17 cells in this column, but not the first 10. Can anyone put me out my misery?
Sub FormatRatesSheet()
Dim myRng As Range
Dim x As Long
Application.ScreenUpdating = False
Set myRng = ActiveSheet.Range("M2", Range("M65536").End(xlUp))
With ActiveSheet
.Range("C1").AutoFilter FIELD:=3, Criteria1:="GBP"
.Range("C1").AutoFilter FIELD:=2, Criteria1:="SWAP"
.Range("C1").AutoFilter FIELD:=9, Criteria1:="=gbp*", Operator:=xlAnd
End With
myRng.SpecialCells(xlCellTypeVisible).Font.ColorIndex = 3
Application.ScreenUpdating = True
End Sub
Thanks in advance.
I've obviously left my brain at home today...:dunno
I'm filtering a list (about 2000 rows) using 3 criteria. This leaves me with a list of about 17-20 rows. I'm trying to colour the font in the first 10 rows in one column but this is where my brain has departed - I can colour all 17 cells in this column, but not the first 10. Can anyone put me out my misery?
Sub FormatRatesSheet()
Dim myRng As Range
Dim x As Long
Application.ScreenUpdating = False
Set myRng = ActiveSheet.Range("M2", Range("M65536").End(xlUp))
With ActiveSheet
.Range("C1").AutoFilter FIELD:=3, Criteria1:="GBP"
.Range("C1").AutoFilter FIELD:=2, Criteria1:="SWAP"
.Range("C1").AutoFilter FIELD:=9, Criteria1:="=gbp*", Operator:=xlAnd
End With
myRng.SpecialCells(xlCellTypeVisible).Font.ColorIndex = 3
Application.ScreenUpdating = True
End Sub
Thanks in advance.