+ Reply to Thread
Results 1 to 10 of 10

Split number into numbers!

  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Talking Split number into numbers!

    how to split a number into multiple smaller numbers?

    For example, there are 17 apples, 22 oranges and 14 peaches to be store into basket.

    Each basket can store 10 apples, so...

    basket1 = 10 apples

    basket2 = 7 apples and 3 oranges

    basket3 = 10 oranges

    basket4 = 9 oranges and 1 peach

    basket5 = 10 peaches

    basket6 = 3 peaches

    How can I do this with vba?..Anyone please help me up
    Last edited by sianjialin; 11-20-2013 at 09:01 PM.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Split number into numbers!

    Can you post a workbook with a before and after example of what the data looks like?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Split number into numbers!

    @sianjialin,

    Here you go, Hope this helps.
    Attached Files Attached Files
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Split number into numbers!

    @sianjialin,

    Ignore the previous one, this is the updated version with user defined basket size.

    Hope this helps.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-07-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Split number into numbers!

    @xlbiznes

    Nice, it work perfectly!!!

    Really appreciated, I learn so much in all these vb codes, thanks you so much!

    I need some upgrade version, because I provide the insufficient information for you guys.

    I go test it first and see whether I can solve it myself or not?..for my poor vba skill, i think i can't!

    I will be back later, hope you guys can help me again.

  6. #6
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Split number into numbers!

    @sianjialin ,

    You are welcome.

    Glad,that i could help. If you are satisfied with the solution , please mark this thread as solved.

  7. #7
    Registered User
    Join Date
    10-07-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Split number into numbers!

    How to mark it?

    Sorry about that, I'm new in vba and this forum.

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Split number into numbers!

    @sianjialin,

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

  9. #9
    Registered User
    Join Date
    10-07-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Split number into numbers!

    done, thanks you so much xlbiznes, I post another thread for additional function, go and take a look there~

  10. #10
    Registered User
    Join Date
    08-18-2015
    Location
    singapore
    MS-Off Ver
    version 7
    Posts
    1

    Re: Split number into numbers!

    hello, for the same problem how to change the vba to cater for different basket qty?

    for example - instead of every basket 10 fruits,

    basket 1 - 4 fruits
    basket 2 - 6 fruits
    basket 3 - 8 fruits

    help~~

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 10-16-2013, 10:21 PM
  2. [SOLVED] Determine whether number of positive numbers exceeds number of negative numbers
    By HRBP in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-04-2012, 09:49 PM
  3. Split numbers and split words
    By Oddemann in forum Excel General
    Replies: 38
    Last Post: 05-10-2009, 02:57 PM
  4. split numbers
    By dodgy99uk in forum Excel General
    Replies: 3
    Last Post: 04-27-2007, 01:48 AM
  5. [SOLVED] Split off numbers
    By Mike R in forum Excel General
    Replies: 4
    Last Post: 09-24-2005, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1