Hello all! This is my first question ever:
I am writing a code in which I use autofilter for option "RET" but in some instances that variable is not present. How can I ask VBA to do nothing if the active cell is blank and to continue with the code if the active cell is not blank?
That is my code and when the cell which
[/CODE]
Thank you very much!
I am writing a code in which I use autofilter for option "RET" but in some instances that variable is not present. How can I ask VBA to do nothing if the active cell is blank and to continue with the code if the active cell is not blank?
Code:
ActiveSheet.Range("$A$1:$T$1000000").AutoFilter Field:=8, Criteria1:="RET"
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 8).Select
ActiveCell.FormulaR1C1 = "0"
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Code:
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 8).Select
returns I want it to do nothing, while if it is not empty I want it to continue with
[CODE] ActiveCell.FormulaR1C1 = "0"
Selection.Copy
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Thank you very much!