Hi Chris
Run this code on the sheet you want checked.
Sub TryThis()
Dim DeleteCells As Range
With Sheet1
.AutoFilterMode = False
.Range("J9").AutoFilter
.Range("J9").AutoFilter Field:=1, Criteria1:="y"
Set DeleteCells = _
.Range("J10:J300").SpecialCells(xlCellTypeVisible)
DeleteCells.EntireRow.Delete
.AutoFilterMode = False
End With
End Sub
If you have blank cells in the range J10:J300 let me know and I'll modify it.
Dave
OzGrid Business Applications
Wow i was having a bad case then, it didnt work but in the end i realised that it was because i had some text writen in J9. Thanks a lot your help is much appreciated.
Chris
The code doesnt seem to do anything at all, the thing worked before because i had returned to my previous version and so got that one which works only up to a few cells that i could be bothered typing. Can you think of any reason, i renamed the sheet to sheet1 as well as changing the look value to Y and even tried it as y, there arent any empty cells in the area. What could be causing this problem can you think
Thanks again
Chris
PS i tried it on office 2000 and office 97
Hi Chris Sub TryThis() Dim DeleteCells As Range With Sheet1 .AutoFilterMode = False .Range("J9").AutoFilter .Range("J9").AutoFilter Field:=1, Criteria1:="y" Set DeleteCells = _ .Range("J10:J300").SpecialCells(xlCellTypeVisible) DeleteCells.EntireRow.Delete .AutoFilterMode = False End With End Sub
If you have blank cells in the range J10:J300 let me know and I'll modify it. Dave
it didnt work, please could u look at the other post i made in this subject-nt-
Re: Doh no it doesnt-help
Thanks again PS i tried it on office 2000 and office 97
Sorry Chris, I should have said I used the sheets Code Name not the Tab name. Use this one, it DOES use the sheet tab name.
With Sheets("Sheet1")
.AutoFilterMode = False
.Range("J9").AutoFilter
.Range("J9").AutoFilter Field:=1, Criteria1:="y"
Set DeleteCells = _
.Range("J10:J300").SpecialCells(xlCellTypeVisible)
DeleteCells.EntireRow.Delete
.AutoFilterMode = False
End With
End Sub
OzGrid Business Applications
Yep that does the trick thanks a lot Dave
thanks u saved my ass, my IT projects in soon and that was the final bit of coding for it that i needed
Chris