Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if filtered cells contain data to delete
Hi all, I need a bit of help with code for the following. I am filtering
a column for certain criteria and i need to check if the other cells in the filtered visual cells contain data, if no data continue with code else delete rows visable only. Selection.AutoFilter Field:=9, Criteria1:="=*za-t-m-**", Operator:=xlAnd Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if filtered cells contain data to delete
With Worksheets("sheet1")
If .AutoFilter.Range.Columns(1).Cells.SpecialCells(xl CellTypeVisible) _ .Count = 1 Then 'Only headers MsgBox "nothing to delete" Else With .AutoFilter.Range .Resize(.Rows.Count - 1).Offset(1, 0).EntireRow.Delete End With End If End With Les Stout wrote: Hi all, I need a bit of help with code for the following. I am filtering a column for certain criteria and i need to check if the other cells in the filtered visual cells contain data, if no data continue with code else delete rows visable only. Selection.AutoFilter Field:=9, Criteria1:="=*za-t-m-**", Operator:=xlAnd Les Stout *** Sent via Developersdex http://www.developersdex.com *** -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if filtered cells contain data to delete
Thanks a lot Dave,
I will give it a bash in the morning and let you know.. Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check if filtered cells contain data to delete
Thank you Dave Peterson, your solution worked 100%, thanks.
Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filling cells with filtered data to another sheet. | New Users to Excel | |||
paste data over hidden cells that are filtered | Excel Worksheet Functions | |||
Copy visible cells on Filtered data | Excel Discussion (Misc queries) | |||
How do I only delete/clear the visible cells in a filtered list? | Excel Worksheet Functions | |||
Macro To Delete Filtered Pivot Table Data | Excel Programming |