View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Trying to F9 sum of random numbers until certain value is reached

Take a look at Goal Seek in Help.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"langba " wrote in message
...
New to macros.....

I'm trying to convince an engineer that there are many possibilities to
a tolerance stackup.

Cells A1:A10 are nominal dimensions. The value doesn't matter.

Cells B1:B10 are all randomly generated plus values from .001 to .060.

Cells C1:C10 are all randomly generate minus values from -.001 to
-.060.

Cell C11 is sum(B1:C10).

What I do is hit F9 until my arm falls off until C11 is .030.

That's what the engineer is looking for over 10 dimensions, .030.

I want a macro to calculate until C11 = .030

I'm trying to show that there are many possibilities.

I read the Visual Basic help pages for hours but defer to you, the
experts.

What I have started with is:

Sub Regen()
If C11 < .030 Then
Calculate
End If
End Sub

I know that won't work because it doesn't.

Thanks in advance.


---
Message posted from http://www.ExcelForum.com/