Public Function FindnCalculate()
Dim fn As Long
Dim cnt As Long
Dim mykW As Double
Dim mykVar As Double
Dim mykVA As Double
Dim p As Integer
'With Application.Range(Cells(lRowCounter - 1, 1), Cells(lRowCounter, 1))
' .Merge
' .VerticalAlignment = xlCenter
' .HorizontalAlignment = xlCenter
'End With
cnt = Range("A" & Rows.Count).End(xlDown).Row
For fn = 1 To cnt
If (Right(Cells(fn, 1), 8)) = "Totals: " And Cells(fn, 10) <> "" Then
p = fn
fn = fn + 15
Cells(fn, 2) = "LOAD SUMMARY:"
'With Application.Range(Cells(fn, 2), Cells(fn, 3))
'.Merge
'.Font.Bold = True
'.HorizontalAlignment = xlCenter
'End With
fn = fn + 1
Cells(fn, 2) = "(100 % continuous load (E) + 30 % Intermittent load (F) + 100% standby (G)) for MCC Sizing"
'With Application.Range(Cells(fn, 2), Cells(fn, 3))
'.Merge
'.Font.Bold = True
'.HorizontalAlignment = xlCenter
'End With
fn = fn - 1
Cells(fn, 5) = "kW"
'Cells(fn, "E").Font.Bold = True
'Cells(fn, "E").HorizontalAlignment = xlCenter
fn = fn + 1
Cells(fn, 5) = Cells(p, 10) + Cells(p, 12) * 0.3 + Cells(p, 14)
fn = fn - 1
Cells(fn, 6) = "kVar"
'Cells(fn, "F").Font.Bold = True
'Cells(fn, "F").HorizontalAlignment = xlCenter
fn = fn + 1
Cells(fn, 6) = Cells(p, 11) + Cells(p, 13) * 0.3 + Cells(p, 15)
fn = fn - 1
Cells(fn, 7) = "kVA"
'Cells(fn, "G").Font.Bold = True
'Cells(fn, "G").HorizontalAlignment = xlCenter
fn = fn + 1
'Cells(fn, 8) = Cells(fn, 5) * Cells(fn, 5)
'Cells(fn, 9) = Cells(fn, 6) * Cells(fn, 6)
'Cells(fn, 10) = Cells(fn, 8) + Cells(fn, 9)
'Cells(fn, 11) = Sqr(Cells(fn, 10))
'Cells(fn, 7).Value = RoundUp(Sqr(Cells(fn, 5).Value * 2) + (Cells(fn, 6).Value * 2))
Cells(fn, 7).Value = WorksheetFunction.RoundUp(Sqr(Cells(fn, 5).Value * 2) + (Cells(fn, 6).Value * 2), 2)
fn = fn + 2
Cells(fn, 2) = "Total Operating load current in MCC = "
'With Application.Range(Cells(fn, 2), Cells(fn, 3))
'.Merge
'.Font.Bold = True
'.HorizontalAlignment = xlCenter
'End With
'=+G58/(1.732*0.38)
Cells(fn, 5) = Cells(fn - 2, 7) / (1.732 * 0.38)
'Range(Cells(fn, 5), Cells(fn, 6), Cells(fn, 7)).Merge = True
'With Application.Range(Cells(fn, 5), Cells(fn, 6), Cells(fn, 7))
'.Merge
'.Font.Bold = True
'.HorizontalAlignment = xlCenter
'End With
End If
Next
End Function