-
Welcome to VBAX
You need to create some spreadsheet output from your userform, which would be the DataSource for your Chart. In this case Time is one of your Chart axes, so you would need include this variable in your calculation. I've applied it in a simple fashion to your code. Time could also be read in from a column of data if appropriate.
Regards
MD
[VBA]
Dim Tim As Long
For Tim = 1 To 60
If OptionButton11 Then
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * SumpLength * SumpWidth) * 7.44 / PumpCapacity * Tim
SumpPumpVolume = SumpHeight * SumpLength * SumpWidth * 7.55
Else
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * 3.14 * 0.25 * SumpDiameter * SumpDiameter) * 7.44 / PumpCapacity * Tim
SumpPumpVolume = SumpHeight * 3.14 * 0.25 * SumpDiameter * SumpDiameter * 7.5
End If
Cells(Tim, 1) = Tim
Cells(Tim, 2) = IntervalBetweenPumpOnAndOff
Next
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules