Log in

View Full Version : Excel macro filters out all data


sue991
Dec 6, 2011, 12:34 PM
Range("A1").Select
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Select
Do Until ActiveCell.EntireRow.Hidden = False
ActiveCell.Offset(1, 0).Select
Loop
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
ActiveSheet.Range("$A$1:$A$500").AutoFilter Field:=1, Operator:= _
xlFilterAutomaticFontColor
Range("A1").Select

Above is the macro I wrote to change the colour of the data in cell A2 and then filter out that data however on some spreadsheets it works, on others it filters out all data. Any ideas why?
Thanks