excel vba - How to sum all the digits in a paragraph (text in a cell)? -
I have an Excel sheet (see image below)
To do this, add all the values of the cells in column 'C' and the value in the respective cell in column 'B' (in my example - 1 + 0.25 + 0.25 + 1 = 2.5). Depending on the input given by the team, the value of column 'C' can change dynamically. As a change in the cell of 'C' column, there is a need to get the requirement to automatically update the value in 'B'.
I tried to ask the producer to change the spreadsheet format
Any help would be greatly appreciated.
Regards, - Ashish
Using this macro, the text in the cell Can be obtained without changing. I have to admit that the implementation will be slightly dim because you need to do some things.
1 - Bring the contents of the entire cell to the token, and store the tokens in the string array.
A problem already exists in the text inside the cell is very inconsistent. You have -250 ms, - 250 ms, - 1 sec, - 1 second due to this, you will need to check for each example. Therefore, you can not just check that the value is a number, you need to check all the permutations that have been provided to you members of your team.
The best way to do this is to have regular expressions. Therefore, should be # 2:
2 - Check each value to see if it matches one of the many 4 regular expressions.
3 - Depending on reggae, numeric value.
a) If just a value (i.e.> 250), check whether MS or sec comes out of value if MS divides by 1000. If the seconds is the same as leaving the number. Add the total number. B) If any number is first (-) dash, delete the dash, and repeat steps a)
c) If after a number letters, remove the letters and repeat steps a)
d) if any duration If after a period, do not do anything. This is a bullet point.
Comments
Post a Comment