How to find Last empty row of Specific Column i.e.,(first name column)

How to find Last empty row of Specific Column i.e.,(first name column)
and get the respective empid of empID column. please find attachment for reference

Hi @Rajesh_Pamu ,

If using the Modern Excel activities, you could check the Find First/Last Data Row activity.
image

If you require it in a Datatable method, then you could check the below :

DT.AsEnumerable.Where(Function(x)Not String.IsNullOrWhiteSpace(x("FirstName").ToString)).Last.Item("EmpId").ToString

Hi

Hope the below steps would help you resolve this

  1. Use read range activity and get the output as a datatable named dt
  2. Now use a assign activity to get the empid value of last empty row of a column

Str_empid = dt.Rows(dt.Rows.Count)(“Empid”).ToString

Cheers @Rajesh_Pamu

Thank you :blush: @supermanPunch its worked

1 Like

it is showing, there is no row at position 10 while using this

Hello @supermanPunch I am getting that empID as 106 by using the given solution as the empty row respective empId is 107 . I can get it by increasing one number but is there any possible to get it by not using increasing the empId.
Thanks in Advance.

@Rajesh_Pamu ,

I believe if that is the case, then you would require to use the below Expression :

DT.AsEnumerable.SkipWhile(Function(x)Not String.IsNullOrWhiteSpace(x("FirstName").ToString)).First.Item("EmpId").ToString
1 Like

Great bro…!!! @supermanPunch Thank you. its working

1 Like

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