Filtering and getting certain data in cells from excel

Hello,
I am trying to get 3 pieces of information from an excel file.
image

I need only the information from D, E, and F
(CONDITION) The only way to tell the difference is if column E ends with a BA or F contains numbers ('aka the last line)
I have tried the filter data table option but not sure if I am doing it right.

Could someone give me a step by step sequence on how I would be able to only get the text from D, E and F of the bottom line using the conditions I explained and display it in 3 seperate 'Message Box’s

@dvn

Use filter Table with isnumeric function for all D, E and F and remove them , you will get the text from D,E and F

Hi,

Try Below approach:

First use ‘filter data table’ to remove columns ‘A’, ‘B’ and ‘C’.
And then,
On filtered Data Table which has remaining columns ‘D’,‘E’ and ‘F’,use bellow code:
For Each Row in Table:
If row(“E”).contains(“BA”) or row(“F”).contains(Numbers),
Then Break.
Else condition not matched.

yes! this worked like a charm

1 Like

Hi @Chaitanya If we use row(“E”).contains(“BA”) it will not satisfy the condition because @dvn asked for column ending with BA So please can u give logic for that.
Thanks in advance.

Hi @AdityaBotMan ,

From given data it is observed that:
1.We need to detect if “BA” is present only in column ‘E’ or not
2.All the rows are numeric other than last row which contains “BA”

Thus this logic worked for @dvn .

In the case, if you always want to check last row, then you can first get total number of Rows(DataTable.Rows.Count) and check if value is present in last row(Value which we got from Rows.Count)

Please let me know if any more information needed.

Regards,
Chaitanya

Hi @chaitanya.kulkarni In the (CONDITION) The only way to tell the difference is if column E ends with a BA. The column E should End with BA if we use contains the condition is not satisfied properly.Hope u understand and give the solution
Thanks in advance

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.