Posts by Whiteroom

    Re: Getting numbers from a string.


    Thank you for the help. I have got that working nicely now. The only issue i have is there is a slight difference somtimes on figures. Occasionally i will get figures like this.


    40, 22 +1
    This means that there are 62 and one coming in. I want to ignore the +1 completely as its only what is there currently im interested in. How would i go about that? (It can be a seperate bit of code to remove the +1 to begin with if thats easier)

    Hi,


    Ive looked at other threads with how to split strings, but i cant seem to get all the information from the string back. Only the first figure.


    I have a cell that can have upto 10 figures in it.


    They are in the format of 40, 31, 20


    Ive used the code stated here but all i get is the 40. I would like to be able to split the string and add the numbers together. This is so i can get a total and an average value from them. Any ideas?


    at the moment my code is


    Quote

    avarSplit = Split(Range("I8").Value, ",")
    Cells(1, 1) = avarSplit


    PS. Sorry for asking in someone elses thread. Thought it would be okay as it was solved for them a while back.

    Re: String Split in vba


    Sorry to resurrect an old thread but this seems to be what i need but i cant seem to get it to work.


    I have a cell that can have upto 10 figures in it.


    They are in the format of 40, 31, 20


    Ive used the code stated here but all i get is the 40. I would like to be able to split the string and add the numbers together. This is so i can get a total and an average value from them. Any ideas?


    at the moment my code is


    Quote

    avarSplit = Split(Range("I8").Value, ",")
    Cells(1, 1) = avarSplit