+ Reply to Thread
Results 1 to 5 of 5

loop to add

  1. #1
    Registered User
    Join Date
    04-25-2010
    Location
    Tipperary
    MS-Off Ver
    Excel 2007
    Posts
    46

    loop to add

    hello all,

    I would like to know is there an easier way to do this.See attached for a dummy example.
    i want to pick 4 random numbers from the list and add them together.i have it done in the attached but is it possible to put into a loop that would make the code better.thanks
    Attached Files Attached Files
    Last edited by aquinlan; 05-17-2010 at 03:55 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: loop to add

    Hi,

    Another way is as follows. Keep a helper column G adjacent to F and in G1 copied down enter =RAND()
    Now with a macro

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-25-2010
    Location
    Tipperary
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: loop to add

    Thanks richard,

    Is there any way you can think rather than using a helper column.All i was hoping for was to use a simple loop.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: loop to add

    Hello aquinlan,

    Is this what you were looking for?
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    04-25-2010
    Location
    Tipperary
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: loop to add

    leith ross thats exactly what i was after.thank you very much.
    and also again to richard thank you for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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