versegi
03-21-2009, 07:45 AM
Hello,
I am complete beginner in VBA, any kind of help is welcome.
I am trying to create program which will calculate water level inside of the tank based on inflow and outflow, and to graph tank water level. This will be simple line graph showing Water Level Vs. Time.
So far I started creating my input and variables but I am completely lost when it comes to creating graph.
This is what I have so far:
Private Sub CommandButton1_Click()
Dim Inflow As Integer
Dim PumpCapacity As Integer
Dim SumpLength As Integer
Dim SumpWidth As Integer
Dim SumpDiameter As Integer
Dim SumpHeight As Integer
Dim TreatmentPlantCapacity As Integer
Dim TreatmentTankVolume As Integer
Dim PumpOn As Integer
Dim PumpOff As Integer
Dim IntervalBetweenPumpOnAndOff As Integer
Dim SumpPumpVolume As Integer
Inflow = TextBox1.Text
PumpCapacity = TextBox2.Text
SumpLength = TextBox3.Text
SumpWidth = TextBox4.Text
SumpDiameter = TextBox5.Text
SumpHeight = TextBox6.Text
TreatmentPlantCapacity = TextBox7.Text
TreatmentTankVolume = TextBox8.Text
PumpOn = SumpHeight - 2
PumpOff = 2
If OptionButton11 Then
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * SumpLength * SumpWidth) * 7.44 / PumpCapacity
SumpPumpVolume = SumpHeight * SumpLength * SumpWidth * 7.55
Else
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * 3.14 * 0.25 * SumpDiameter * SumpDiameter) * 7.44 / PumpCapacity
SumpPumpVolume = SumpHeight * 3.14 * 0.25 * SumpDiameter * SumpDiameter * 7.5
End If
TextBox9 = PumpOn
TextBox10 = PumpOff
TextBox11 = IntervalBetweenPumpOnAndOff
TextBox12 = SumpPumpVolume
End Sub
Thank you.
I am complete beginner in VBA, any kind of help is welcome.
I am trying to create program which will calculate water level inside of the tank based on inflow and outflow, and to graph tank water level. This will be simple line graph showing Water Level Vs. Time.
So far I started creating my input and variables but I am completely lost when it comes to creating graph.
This is what I have so far:
Private Sub CommandButton1_Click()
Dim Inflow As Integer
Dim PumpCapacity As Integer
Dim SumpLength As Integer
Dim SumpWidth As Integer
Dim SumpDiameter As Integer
Dim SumpHeight As Integer
Dim TreatmentPlantCapacity As Integer
Dim TreatmentTankVolume As Integer
Dim PumpOn As Integer
Dim PumpOff As Integer
Dim IntervalBetweenPumpOnAndOff As Integer
Dim SumpPumpVolume As Integer
Inflow = TextBox1.Text
PumpCapacity = TextBox2.Text
SumpLength = TextBox3.Text
SumpWidth = TextBox4.Text
SumpDiameter = TextBox5.Text
SumpHeight = TextBox6.Text
TreatmentPlantCapacity = TextBox7.Text
TreatmentTankVolume = TextBox8.Text
PumpOn = SumpHeight - 2
PumpOff = 2
If OptionButton11 Then
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * SumpLength * SumpWidth) * 7.44 / PumpCapacity
SumpPumpVolume = SumpHeight * SumpLength * SumpWidth * 7.55
Else
IntervalBetweenPumpOnAndOff = ((PumpOn - PumpOff) * 3.14 * 0.25 * SumpDiameter * SumpDiameter) * 7.44 / PumpCapacity
SumpPumpVolume = SumpHeight * 3.14 * 0.25 * SumpDiameter * SumpDiameter * 7.5
End If
TextBox9 = PumpOn
TextBox10 = PumpOff
TextBox11 = IntervalBetweenPumpOnAndOff
TextBox12 = SumpPumpVolume
End Sub
Thank you.