Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello - is there a way (I'm sure there is but I'm not smart enough to figure it out) to test whether a filter vba command will result in wiping out all data?
Sub test() 'delete rows that contain the word "paper" in Column D Worksheets("Sheet1").Range("A1").AutoFilter Field:=4, Criteria1:="<*paper*" Application.DisplayAlerts = False ActiveSheet.UsedRange.Offset(1, 0).Resize(ActiveSheet.UsedRange.Rows.Count - 1).Rows.Delete Application.DisplayAlerts = True ActiveSheet.ShowAllData 'end of "paper" check 'start next sequence ..etc Columns("F:F").Select etc, etc, etc End Sub In other words, if the data set does not have the keyword "paper" in Column D, then the above vba commands will delete all the data. Looking for a macro that will precede the above to check whether Column D has any instances of the word "paper" *BEFORE* running the macro. If no "paper" exists in the Column, then the sequence should be bypassed and continue to the next set of vba commands immediately after (ie. jump immediately to Selecting Column F as shown above). Thank you in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro / Autofilter / Show All Data | Excel Discussion (Misc queries) | |||
How can I use Text to wipe out subsequent dates? | Excel Discussion (Misc queries) | |||
How to stop the last record always appearing when I Autofilter | Excel Discussion (Misc queries) | |||
how to stop/ restart macro after selecting from autofilter list | Excel Discussion (Misc queries) | |||
Stop Macro if there is no data | Excel Programming |