+ Reply to Thread
Results 1 to 10 of 10

coding to add values until a certain limit

Hybrid View

dan2010 coding to add values until a... 08-16-2010, 01:16 AM
royUK Re: coding to add values... 08-16-2010, 01:23 AM
dan2010 Re: coding to add values... 08-16-2010, 03:47 AM
dan2010 Re: coding to add values... 08-16-2010, 03:54 AM
Andrew-R Re: coding to add values... 08-16-2010, 04:40 AM
dan2010 Re: coding to add values... 08-16-2010, 04:50 AM
Andrew-R Re: coding to add values... 08-16-2010, 04:56 AM
dan2010 Re: coding to add values... 08-16-2010, 05:05 AM
Andrew-R Re: coding to add values... 08-16-2010, 05:11 AM
dan2010 Re: coding to add values... 08-16-2010, 05:18 AM
  1. #1
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: coding to add values until a certain limit

    Rather than messing around with deleting rows you'd be better off with:

    i=0
    While Sum+sheet1.Cells(i+2,3).Value=<Budget And i<10000
      sum=sum+sheet1.Cells(i+2,3).Value
      for cellloop=1 to 3
        sheet2.cells(i+2,cellloop).value=sheet1.cells(i+2,cellloop)
      next cellloop
      i=i+1
    wend
    That should avoid the problem of going over budget.

  2. #2
    Forum Contributor
    Join Date
    08-04-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    143

    Re: coding to add values until a certain limit

    all right. thanks alot

+ 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