Okay, so I am having to do a little research... I need to perform some operations on a range of cells (in a column) in Excel, and need a little help getting it done.
Here's what I have to do:
Cells in the column contain comma separated whole numbers: "1,4,5,6,7" or "1,2,3,9,11,13" etc.
I need to count the occurrences of each integer in a given column (all of the cells of the range). I was able to count the occurences of a number in a range, but it counted the digits that were part of two-digit numbers as well which gives me an incorrect count.
I was thinking about looping through the rows in a column, and splitting the each cell's value into an array, then counting the elements in the arrays with a certain value, but I wasn't sure how to read the cells into arrays or count the elements and write it back to a cell.
Can anyone help me out? I've written several apps in VB.NET, but none involved reading/writing to Excel. I'm sorry if I didn't explain it well, but I would be happy to try to explain better if it might help. Thanks in advance.
Question
Chsoriano
Okay, so I am having to do a little research... I need to perform some operations on a range of cells (in a column) in Excel, and need a little help getting it done.
Here's what I have to do:
Cells in the column contain comma separated whole numbers: "1,4,5,6,7" or "1,2,3,9,11,13" etc.
I need to count the occurrences of each integer in a given column (all of the cells of the range). I was able to count the occurences of a number in a range, but it counted the digits that were part of two-digit numbers as well which gives me an incorrect count.
I was thinking about looping through the rows in a column, and splitting the each cell's value into an array, then counting the elements in the arrays with a certain value, but I wasn't sure how to read the cells into arrays or count the elements and write it back to a cell.
Can anyone help me out? I've written several apps in VB.NET, but none involved reading/writing to Excel. I'm sorry if I didn't explain it well, but I would be happy to try to explain better if it might help. Thanks in advance.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts