If you want to filter excel sheet, I’ll suggest you to use Filter Table activity
take Filter Table activity Excel Application Scope and set the workbook path.
Set all the parameters like sheetName, ColumnName and table name. as shown in below shot.
for the table name, first you have to create table in excel and pass that table name in activity parameter
Set the FilterOptions —> {“”}
So it’ll filter table on rows whose values are blanks of specified column.
If the number of columns is fixed then You can get the range of the data table…
1.Like the column is known and the rows count can be derived by DT.rows.count
2.Then you can give the range as “A”+DT.rows.count.tostring+“ColumnCountAlphabet”+DT.rows.count.tostring
Hey, @samir
There’ll be multiple data in it,
For example, in Column1 - there’ll be blank cells, cells with A1, A2, A3 data.
I need to delete all the rows with cell containing only A2 data, but keep all rows with cell containing blank,A1 and A3 data.
I’m trying, how to use Not Equal to in filter options of filter table activity.
But there’s an alternate option, which is recording a macro in excel and use it by using Invoke VBA activity
here’s the Example code,
Sub Macro1()
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=5, Criteria1:= _
"<>A2", Operator:=xlAnd
End Sub
This worked well.
but, as you can see I’ve used “<>A2” but while using <> in filter option it’s giving error.
So using recording macro by clicking on,
column filter.
text filters.
Does Not Equal to
and then give value as A2, click OK.
Ex from your excel → row(2).toString = YourString
or u can use like
IF
String.isNullorEmpty(YourString)
Then → Will pass
Else → Will perform what you whant