Copy the worksheet column into the array of respected datatype?

excel

#1

I’m curious to know whether we can copy entire column into array(respected column’s data type),if possible someone please share your ideas.


#2

Easier way would be to read in the whole sheet into a datatable and remove the columns you don’t need or just reference or output the required column.


#3

I need to copy the column data into array ,is that possible?


#4

Do you need to do this directly from the worksheet? If not then once you have the data in the datatable you could loop through the column you want and add it to the array?

E.g. for each item in column
add to data array
Next

Is that what you need?


#5

Here You can use List to do the required operation…

But I don’t think we can store it in Array since we are unable to Initialize array as we are doing in c#…

Ex: String[] input= new String[SizeofCoumn]… this is the required initialization…

Please be revert with response…:slight_smile:


#6

@sankar.kuna i can initialize the array but i cant copy the worksheet data into it ,data type error .


#7

Here’s an example to get the data with the required datatype in a colleciton
Trial.zip (7.9 KB)


#8

Hi Ranjit…can u share ur xaml ?