How to do sum of values for the entire column of different sheets

how to do sum of values for entire column and for different sheets and enter the values at the main sheet linely

@anjani_priya

Please try this

Dt.AsEnumerable.Sum(function(x) If(IsNumeric(x("ColumnName").ToString), CDBL(x("ColumnName").ToString),0)).ToString

Cheers

Iam getting an error
I shared shared the error to you can you check that

@anjani_priya

I saw the error that is when I added an if condition to check for numeric and then get sum

Cheers

hi @anjani_priya

sumOfColumn = columnData.Where(Function(x) Not String.IsNullOrEmpty(x.ToString)).Select(Function(x) Double.Parse(x.ToString)).Sum()

how to take a particular column in a sheet?

@anjani_priya

  1. Read that excel file (Workbook or Excel Activities)… ( dt_Sheet)
    2.Use Assign Activity
    columnData as List(Of String)= dtSheet.AsEnumerable().Select(Function(row) row(“YourColumnName”).ToString()).ToList()

where is list(of string) data type


getting an error

@anjani_priya

In the variable panel after naming the variable go to Browse for types

System.Collections.Generic.list

yes I have got but iam getting an error
I want to append 21 sheets

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