Hello everyone,
I tried to put an autofilter in my VBA code but dunno how to put de IF statement if the criteria does not exist
If the criteria does not exist, I just want the code to proceed forward.
Some info about my file
My workbook is a table format
I have a column for checking with Yes or Not and I want to autofilter "Not" and delete the cells, and its work, but when I do not have "Not" and only "Yes", the autofilter is happened (its activated but disapear all data) and broke the code
This is my autofilter and detele code
Set Rng = range("Table1")
Rng.AutoFilter Field:=54, Criteria1:="NU"
range("Table1[#Headers]").Select
Rng.SpecialCells(xlCellTypeVisible).Select
Rng.SpecialCells(xlCellTypeVisible).Delete
Also, if somebody can tell me how can I skip (or automatically press "OK") on the delete message box
Any answer it will be more than useful
Thank you
I tried to put an autofilter in my VBA code but dunno how to put de IF statement if the criteria does not exist
If the criteria does not exist, I just want the code to proceed forward.
Some info about my file
My workbook is a table format
I have a column for checking with Yes or Not and I want to autofilter "Not" and delete the cells, and its work, but when I do not have "Not" and only "Yes", the autofilter is happened (its activated but disapear all data) and broke the code
This is my autofilter and detele code
Set Rng = range("Table1")
Rng.AutoFilter Field:=54, Criteria1:="NU"
range("Table1[#Headers]").Select
Rng.SpecialCells(xlCellTypeVisible).Select
Rng.SpecialCells(xlCellTypeVisible).Delete
Also, if somebody can tell me how can I skip (or automatically press "OK") on the delete message box
Any answer it will be more than useful
Thank you