Untitled
unknown
plain_text
17 days ago
1.8 kB
1
Indexable
Never
Function SumOfResults(ByVal X As Single, ByVal Y As Single, ByVal x01 As Single, ByVal y01 As Single, ByVal KAPPA As Single, _ ByVal x02 As Single, ByVal y02 As Single, ByVal hat As Single, ByVal x03 As Single, _ ByVal y03 As Single, ByVal gamma As Single, ByVal U As Single, ByVal alpha As Single) As Single SumOfResults = FDOUB(X, Y, x01, y01, KAPPA) + Fpsands(X, Y, x02, y02, hat) + fvortex(X, Y, x03, y03, gamma) + UniformFlowStreamFunction(X, Y, U, alpha) End Function Sub CalculateAndPlaceResult() ' Variables for FDOUB Dim x01 As Single, y01 As Single, KAPPA As Single ' Variables for Fpsands Dim x02 As Single, y02 As Single, hat As Single ' Variables for fvortex Dim x03 As Single, y03 As Single, gamma As Single ' Variables for UniformFlowStreamFunction Dim U As Single, alpha As Single ' Assign Values to each variable y01 = Range("J8").Value x01 = Range("J7").Value KAPPA = Range("J6").Value y02 = Range("F8").Value x02 = Range("F7").Value hat = Range("F6").Value y03 = Range("L8").Value x03 = Range("L7").Value gamma = Range("L6").Value U = Range("D6").Value alpha = Range("D7").Value ' Determine the size of the range to calculate Dim lastCol As Long, lastRow As Long lastCol = Range("E12").End(xlToRight).Column - Range("E12").Column + 1 lastRow = Range("D13").End(xlDown).Row - Range("D13").Row + 1 Dim i As Long, j As Long For i = 1 To lastCol For j = 1 To lastRow Cells(j + 12, i + 4).Value = SumOfResults(Cells(12, i + 4).Value, Cells(j + 12, 4).Value, x01, y01, KAPPA, x02, y02, hat, x03, y03, gamma, U, alpha) Next j Next i End Sub
Leave a Comment