'__________________________________________________________Current Carrying Capacity Column____________'
If TwoCoresCables Then Column = 2
If ThreeFourCoresCables Then Column = 38
If DC Then Column = Column + 0 'Column = 2
If DC Then Multiplier = 1
If SingleAC Then Column = Column + 8 'Column = 10
If SingleAC Then Multiplier = 4
If ThreeAC Then Column = Column + 0 'Column = 38
If ThreeAC Then Multiplier = 4
If Method1 Then Column = Column + Multiplier * 0
If OneTrefoil Then Column = Column + Multiplier * 7
If Method3 Then Column = Column + Multiplier * 1
If Method4 Then Column = Column + Multiplier * 2
If Method11 Then Column = Column + Multiplier * 3
If ElevenTrefoil Then Column = Column + Multiplier * 8
If Horizontal Then Column = Column + Multiplier * 4
If Vertical Then Column = Column + Multiplier * 5
If TwelveTrefoil Then Column = Column + Multiplier * 9
If Method13 Then Column = Column + Multiplier * 6
'_____________________________________________________________________Table / Conductor Row____________'
If Aluminium Then
Table = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(10, Column), Worksheets(WorksheetName).Cells(26, 78))
ConductorRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(10, Column), Worksheets(WorksheetName).Cells(26, Column))
VoltageDCRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(10, 10), Worksheets(WorksheetName).Cells(26, 10))
VoltageACRRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(10, Column + VoltageDropColumnR), Worksheets(WorksheetName).Cells(26, Column + VoltageDropColumnR))
End If
If Copper Then
Table = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(28, Column), Worksheets(WorksheetName).Cells(49, 78))
ConductorRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(28, Column), Worksheets(WorksheetName).Cells(49, Column))
VoltageDCRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(28, 10), Worksheets(WorksheetName).Cells(49, 10))
[COLOR=#ff0000]VoltageACRRow = Worksheets(WorksheetName).Range(Worksheets(WorksheetName).Cells(28, Column + VoltageDropColumnR), Worksheets(WorksheetName).Cells(49, Column + VoltageDropColumnR))[/COLOR]
End If
'_________________________________________________________________________Cable Size Column____________'
CableColumn = 79 - Column
'_______________________________________________________________________Voltage Drop Column____________'
VoltageDropColumnDC = 11 - Column
VoltageDropColumnR = 2
VoltageDropColumnX = 3
'_________________________________________________________________________Empty Cells Check____________'
'_________________________________________________________________________Find Voltage Drop____________'
j = 1
If DC Then
DCVoltageDrop:
[COLOR=#00ff00]VoltageDropDC = WorksheetFunction.Index(Table, WorksheetFunction.Match(Val(LoadCurrentText), ConductorRow, 1) + j, VoltageDropColumnDC)[/COLOR]
DesignCurrent = MotorRatingText / ((EfficiencyText / 100) * DCText)
CalculatedVoltageDrop = (VoltageDropDC * DesignCurrent * CableLengthText) / 1000
End If
If SingleAC Or ThreeAC Then
ACVoltageDrop:
[COLOR=#00ff00] VoltageDropR = WorksheetFunction.Index(Table, WorksheetFunction.Match(Val(LoadCurrentText), ConductorRow, 1) + j, VoltageDropColumnR)
VoltageDropX = WorksheetFunction.Index(Table, WorksheetFunction.Match(Val(LoadCurrentText), ConductorRow, 1) + j, VoltageDropColumnX)[/COLOR]
Angle = WorksheetFunction.Acos(PowerFactorText)
SineAngle = Sin(Angle)
If SingleAC Then ACText = SingleACText
If ThreeAC Then ACText = ThreeACText * (3 ^ (1 / 2))
DesignCurrent = MotorRatingText / (PowerFactorText * (EfficiencyText / 100) * ACText)
CalculatedVoltageDrop = (((VoltageDropR * PowerFactorText) + (VoltageDropX * SineAngle)) * DesignCurrent * CableLength) / 1000
End If
'_______________________________________________________________________________Output Loss____________'
[COLOR=#ff8c00] If DC Then InputVoltage = DCText
If SingleAC Or ThreeAC Then InputVoltage = ACText
VoltageLoss = CalculatedVoltageDrop / InputVoltage
VoltageLossPercentage = VoltageLoss / 100
If VoltageLossPecentage >= Loss Then
j = j + 1
If DC Then GoTo DCVoltageDrop
If SingleAC Or ThreeAC Then GoTo ACVoltageDrop
End If[/COLOR]
'___________________________________________________________________________Find Cable Size____________'
[COLOR=#ffa07a] If DC Then CableSize = WorksheetFunction.Index(Table, WorksheetFunction.Match(VoltageDropDC, VoltageDCRow, 0), CableColumn)[/COLOR]
[COLOR=#ff0000]If SingleAC Or ThreeAC Then CableSize = WorksheetFunction.Index(Table, WorksheetFunction.Match(VoltageDropR, VoltageACRRow, 0), CableColumn)[/COLOR]
'______________________________________________________________________________________Calc____________'
Calc = Calc & vbNewLine & "VoltageLoss: " & VoltageLoss
Calc = Calc & vbNewLine & "VoltageLossPercentage: " & VoltageLossPercentage & "%"
Calc = Calc & vbNewLine & "CableSize: " & CableSize
If DC Then Calc = Calc & vbNewLine & "VoltageDrop: " & VoltageDropDC
If SingleAC Or ThreeAC Then
Calc = Calc & vbNewLine & "VoltageDropR: " & VoltageDropR
Calc = Calc & vbNewLine & "VoltageDropX: " & VoltageDropX
Calc = Calc & vbNewLine & "Angle: " & Angle
Calc = Calc & vbNewLine & "SineAngle: " & SineAngle
End If
Calc = Calc & vbNewLine & "DesignCurrent: " & DesignCurrent
Calc = Calc & vbNewLine & "CalculatedVoltageDrop: " & CalculatedVoltageDrop
Messages = Msg & Change & Changes & Calc
'_____________________________________________________________________________Final Display____________'
Display9.Text = Messages
Display9.MultiLine = True