obrigado a todos! Edson era isso mesmo, funcionou. Segue abaixo o código completo e funcionando.
Function calcinverter(a As String, b As String, c As String)
Dim xvi() As String
Dim yvi() As String
Dim zvi() As String
Dim i As Integer
Dim ninv(0 To 9) As Single
Dim av() As Single
Dim bv() As Single
Dim cv() As Single
Dim maxpower As Single
Dim minpower As Single
Sheets("System Specification").Select
ninv(0) = Range("B3")
xvi = Split(a, "/")
yvi = Split(b, "/")
zvi = Split(c, "/")
ReDim av(4, UBound(xvi))
ReDim bv(UBound(yvi))
ReDim cv(UBound(zvi))
For i = LBound(xvi) To UBound(xvi)
av(0, i) = CSng(xvi(i))
bv(i) = CSng(yvi(i))
cv(i) = CSng(zvi(i))
av(1, i) = ninv(0) av(0, i)
av(2, i) = ninv(0) Mod av(0, i)
If i > 0 Then
If av(1, i - 1) > av(1, i) And av(1, i) >= 1 Then
ninv(1) = av(1, i)
ninv(2) = av(0, i)
ninv(3) = av(2, i)
ninv(8) = cv(i)
End If
Else
ninv(1) = av(1, i)
ninv(2) = av(0, i)
ninv(3) = av(2, i)
ninv(8) = cv(i)
End If
Next i
If ninv(3) > 0 Then
For i = LBound(xvi) To UBound(xvi)
av(3, i) = ninv(3) av(0, i)
av(4, i) = ninv(3) Mod av(0, i)
If i > 0 Then
If av(4, i - 1) > av(4, i) And av(4, i - 1) > 0 Then
ninv(4) = av(3, i)
ninv(5) = av(0, i)
ninv(6) = av(4, i)
ninv(9) = cv(i)
End If
Else
ninv(4) = av(3, i) + 1
ninv(5) = av(0, i)
ninv(6) = av(4, i)
ninv(9) = cv(i)
End If
Next i
End If
maxpower = ninv(1) * ninv(2) + ninv(4) * ninv(5)
minpower = ninv(1) * ninv(8) + ninv(4) * ninv(9)
ninv(7) = ninv(4) + ninv(1)
End Function
Postado : 04/05/2017 10:15 pm