Sub Project_8_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 08_Composite rotation_EN ' Updated: 26/03/24 ' Created by: Ariel R. Becerra (21/11/23) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 8 in the name of this function must match the one in the list of the CONFIG sheet for this project. If not, please correct it. ' Note 2: This code will be integrated into the main code to automate the download of the project. ' Note 3: The formulas and cell values generated here correspond only to the first 30 columns from INICIO to the right in the sheet. All your formulas and values are recommended to be written in these columns. ' Step 1. Go to the CONFIG sheet and add a short name and the number of your new project to the last row in the projects list. ' Step 2. Make sure that the list of projects in CONFIG sheet has the correct ascending numbering. ' Step 4. Open the VBA editor (Alt + F11 in Windows or Fn + Option + F11 in macOS). To avoid mistakes, make sure you only have one workbook open. ' Step 5. On the left, in the project explorer, select a non full module (or add a new one). ' Step 6. Select all the code in this file, copy and paste it at the end of the existing code in the module (or in the new one). ' Step 7. To load the project and to check it in a new sheet, go to the CONFIG sheet and click the New Sheet button, then select the project from the list and click the +Vector button. ' Step 8. Click any XYZ button to get the project in the coordinate system. Enjoy it! ' Visit www.sciensolar.com for news and updates of ? ScienSolar. Cells(m1 - 1, n1 + 2).FormulaR1C1 = "1" Cells(m1 + 0, n1 + 0).FormulaR1C1 = "51" Cells(m1 + 0, n1 + 1).FormulaR1C1 = "68" Cells(m1 + 0, n1 + 2).FormulaR1C1 = "=CONFIG!R3C4" Cells(m1 + 0, n1 + 3).FormulaR1C1 = "850" Cells(m1 + 0, n1 + 6).FormulaR1C1 = "=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 = "1" Cells(m1 + 0, n1 + 8).FormulaR1C1 = "Ariel R. Becerra (21/11/23)" Cells(m1 + 1, n1 + 2).FormulaR1C1 = "=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 = "400" Cells(m1 + 1, n1 + 4).FormulaR1C1 = "=CONFIG!R4C6" Cells(m1 + 1, n1 + 5).FormulaR1C1 = "0" Cells(m1 + 1, n1 + 6).FormulaR1C1 = "=CONFIG!R4C8" Cells(m1 + 1, n1 + 7).FormulaR1C1 = "45" Cells(m1 + 2, n1 + 2).FormulaR1C1 = "=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 = "20" Cells(m1 + 2, n1 + 4).FormulaR1C1 = "=CONFIG!R5C6" Cells(m1 + 2, n1 + 5).FormulaR1C1 = "15" Cells(m1 + 2, n1 + 6).FormulaR1C1 = "=CONFIG!R5C8" Cells(m1 + 2, n1 + 7).FormulaR1C1 = "0" Cells(m1 + 3, n1 + 0).FormulaR1C1 = "a" Cells(m1 + 3, n1 + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 = "200" Cells(m1 + 3, n1 + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m1 + 3, n1 + 5).FormulaR1C1 = "15" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "ROTACI" & ChrW(211) & "N DE UN VECTOR ALREDEDOR DE UN VECTOR UNITARIO" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " Modifique los valores en G10 y G11 y observe los resultados oprimiendo el bot" & ChrW(243) & "n Run. Esto lo puede ver desde diferentes perspectivas con los botones de coordenadas XYZ, YZ, XZ, XY." & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " ROTATION OF A VECTOR ABOUT A UNIT VECTOR" & Chr(10) & _ " Modify the values in cells G10 y G11 and observe the results by pressing the Run button. You can see this from different perspectives with the XYZ, YZ, XZ, XY coordinate buttons." & Chr(10) & _ " " & Chr(10) & _ " " Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 11 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "a" Cells(m + 3, n + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 = "200" Cells(m + 3, n + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m + 3, n + 5).FormulaR1C1 = "15" Cells(m + 3, n + 19).FormulaR1C1 = "1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Composite rotation" Cells(m + 4, n + 12).FormulaR1C1 = "COMPOSITE ROTATION" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 7, n + -1).FormulaR1C1 = "3" Cells(m + 7, n + 0).FormulaR1C1 = "3" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 4).FormulaR1C1 = " P =" Cells(m + 7, n + 5).FormulaR1C1 = "2" Cells(m + 7, n + 21).FormulaR1C1 = "This model is based on the ROTATION OF A VECTOR model and is extended for several vectors," Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = " K =" Cells(m + 8, n + 5).FormulaR1C1 = "8" Cells(m + 8, n + 21).FormulaR1C1 = "whose number can be increased. Each vector is subjected to the rotation matrix:" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "4" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 3).FormulaR1C1 = "Number of vectors:" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 5).FormulaR1C1 = "=COUNTIF(C[-3],""r_*"")" Cells(m + 10, n + 27).FormulaR1C1 = "(Eq-7-2)" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "7434613" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "A" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 10 Call Project_15(15, m, n, m1, n1) Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "A" Cells(m + 3, n + 2).FormulaR1C1 = "To trace the path of a vector:" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "186" Cells(m + 4, n + 2).FormulaR1C1 = "1. Max. steps = length of graph." Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 2).FormulaR1C1 = "2. Click Reset Graph." Cells(m + 6, n + -1).FormulaR1C1 = "Choose the vector to make its graphic:" Cells(m + 6, n + 2).FormulaR1C1 = "3. Choose an odd vector from the combo box." Cells(m + 7, n + -1).FormulaR1C1 = "0" Cells(m + 7, n + 0).FormulaR1C1 = "0" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "4. Run the simulation." Cells(m + 7, n + 21).FormulaR1C1 = "where the angle can vary with the parameter t," Cells(m + 8, n + -1).FormulaR1C1 = "Max. steps:" Cells(m + 8, n + 0).FormulaR1C1 = "45" Cells(m + 8, n + 2).FormulaR1C1 = " " Cells(m + 9, n + 2).FormulaR1C1 = " " Cells(m + 9, n + 27).FormulaR1C1 = "(Eq-7-5)" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 2).FormulaR1C1 = " " Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 18).FormulaR1C1 = "=IF(RC[-18]>0,""<-- use these cells."","""")" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 2).FormulaR1C1 = " " Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "and also w can take any form, which in this particular case:" Cells(m + 3, n + 1).Interior.Color = "7434613" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "u" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 9 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 = "u" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 27).FormulaR1C1 = "(Eq-7-4)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 6, n + 21).FormulaR1C1 = "K and P are parameters that depend on the number of the vector. Modify the value of these" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-16]C+R[-18]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-16]C+R[-18]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-16]C+R[-18]C" Cells(m + 7, n + 21).FormulaR1C1 = "parameters in cells G10 and G11. The initial orientation of the vectors and their coordinates" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "can be customized in rows 39, 57, 75 and 93 respectively for each vector." Cells(m + 9, n + -1).FormulaR1C1 = "=R[-18]C/SQRT(R[-18]C^2+R[-18]C[1]^2+R[-18]C[2]^2)" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-18]C/SQRT(R[-18]C[-1]^2+R[-18]C^2+R[-18]C[1]^2)" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-18]C/SQRT(R[-18]C[-2]^2+R[-18]C[-1]^2+R[-18]C^2)" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "Press Run to view the simulation. Change the parameters K and P to obtain" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "different configurations." Cells(m + 3, n + 1).Interior.Color = "7434613" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 27 Then ' vector 8 Cells(m + 3, n + -1).FormulaR1C1 = "=(R[-9]C+1)*R6C1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "The paths of the odd vectors can be drawn. To draw the trajectory of the" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 5, n + 21).FormulaR1C1 = "vector 7, press Reset Graph, select this vector from the list located in C19 and press Run." Cells(m + 7, n + -1).FormulaR1C1 = "=R[-27]C+R[-25]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-27]C+R[-25]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-27]C+R[-25]C" Cells(m + 7, n + 21).FormulaR1C1 = "To add or remove additional vectors to the model use the +OBJ and -OBJ buttons." Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "0" Cells(m + 9, n + 2).FormulaR1C1 = "=""<< --- Vector "" &R[3]C[-1]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "0" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16776960" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 36 Then ' vector 7 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-18]C+2" Cells(m + 3, n + 1).FormulaR1C1 = "1" Cells(m + 3, n + 2).FormulaR1C1 = "=""r_""&RC[-1]" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = " w. =" Cells(m + 4, n + 3).FormulaR1C1 = "=R11C7*POWER(R10C7,R[-1]C[-2]-1)" Cells(m + 4, n + 4).FormulaR1C1 = "(Eq-7-4)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 2).FormulaR1C1 = "=SIN(RADIANS(R[-1]C[1]*R5C9))" Cells(m + 5, n + 3).FormulaR1C1 = "=1-COS(RADIANS(R[-1]C*R5C9))" Cells(m + 5, n + 4).FormulaR1C1 = "(Eq-7-3)" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C+R[-4]C[4]*(R30C2*R30C1*R[-9]C[1]-R30C2*R30C2*R[-9]C+R30C3*R30C1*R[-9]C[2]-R30C3*R30C3*R[-9]C)+R[-4]C[3]*(R30C2*R[-9]C[2]-R30C3*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C+R[-4]C[3]*(-R30C1*R30C1*R[-9]C+R30C1*R30C2*R[-9]C[-1]+R30C3*R30C2*R[-9]C[1]-R30C3*R30C3*R[-9]C)+R[-4]C[2]*(-R30C1*R[-9]C[1]+R30C3*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C+R[-4]C[2]*(-R30C1*R30C1*R[-9]C+R30C1*R30C3*R[-9]C[-2]-R30C2*R30C2*R[-9]C+R30C2*R30C3*R[-9]C[-1])+R[-4]C[1]*(R30C1*R[-9]C[-1]-R30C2*R[-9]C[-2])" Cells(m + 9, n + 2).FormulaR1C1 = "(Eq-7-2)" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "9851952" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 45 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 = "=(R[-9]C+1)*R6C1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "0" Cells(m + 9, n + 2).FormulaR1C1 = "=""<< --- Vector "" &R[3]C[-1]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "0" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16776960" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 54 Then ' vector 5 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-18]C+2" Cells(m + 3, n + 1).FormulaR1C1 = "=R[-18]C+1" Cells(m + 3, n + 2).FormulaR1C1 = "=""r_""&RC[-1]" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 4, n + 2).FormulaR1C1 = "w =" Cells(m + 4, n + 3).FormulaR1C1 = "=R11C7*POWER(R10C7,R[-1]C[-2]-1)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 2).FormulaR1C1 = "=SIN(RADIANS(R[-1]C[1]*R5C9))" Cells(m + 5, n + 3).FormulaR1C1 = "=1-COS(RADIANS(R[-1]C*R5C9))" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C+R[-4]C[4]*(R30C2*R30C1*R[-9]C[1]-R30C2*R30C2*R[-9]C+R30C3*R30C1*R[-9]C[2]-R30C3*R30C3*R[-9]C)+R[-4]C[3]*(R30C2*R[-9]C[2]-R30C3*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C+R[-4]C[3]*(-R30C1*R30C1*R[-9]C+R30C1*R30C2*R[-9]C[-1]+R30C3*R30C2*R[-9]C[1]-R30C3*R30C3*R[-9]C)+R[-4]C[2]*(-R30C1*R[-9]C[1]+R30C3*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C+R[-4]C[2]*(-R30C1*R30C1*R[-9]C+R30C1*R30C3*R[-9]C[-2]-R30C2*R30C2*R[-9]C+R30C2*R30C3*R[-9]C[-1])+R[-4]C[1]*(R30C1*R[-9]C[-1]-R30C2*R[-9]C[-2])" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "9851952" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 63 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 = "=(R[-9]C+1)*R6C1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "0" Cells(m + 9, n + 2).FormulaR1C1 = "=""<< --- Vector "" &R[3]C[-1]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "0" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16776960" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 72 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-18]C+2" Cells(m + 3, n + 1).FormulaR1C1 = "=R[-18]C+1" Cells(m + 3, n + 2).FormulaR1C1 = "=""r_""&RC[-1]" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 4, n + 2).FormulaR1C1 = "w =" Cells(m + 4, n + 3).FormulaR1C1 = "=R11C7*POWER(R10C7,R[-1]C[-2]-1)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 2).FormulaR1C1 = "=SIN(RADIANS(R[-1]C[1]*R5C9))" Cells(m + 5, n + 3).FormulaR1C1 = "=1-COS(RADIANS(R[-1]C*R5C9))" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C+R[-4]C[4]*(R30C2*R30C1*R[-9]C[1]-R30C2*R30C2*R[-9]C+R30C3*R30C1*R[-9]C[2]-R30C3*R30C3*R[-9]C)+R[-4]C[3]*(R30C2*R[-9]C[2]-R30C3*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C+R[-4]C[3]*(-R30C1*R30C1*R[-9]C+R30C1*R30C2*R[-9]C[-1]+R30C3*R30C2*R[-9]C[1]-R30C3*R30C3*R[-9]C)+R[-4]C[2]*(-R30C1*R[-9]C[1]+R30C3*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C+R[-4]C[2]*(-R30C1*R30C1*R[-9]C+R30C1*R30C3*R[-9]C[-2]-R30C2*R30C2*R[-9]C+R30C2*R30C3*R[-9]C[-1])+R[-4]C[1]*(R30C1*R[-9]C[-1]-R30C2*R[-9]C[-2])" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "9851952" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 81 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "=(R[-9]C+1)*R6C1" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "1" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "0" Cells(m + 9, n + 2).FormulaR1C1 = "=""<< --- Vector "" &R[3]C[-1]" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "0" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16776960" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Call AddNewVector End If ' vector ends If m = m1 + 90 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-18]C+2" Cells(m + 3, n + 1).FormulaR1C1 = "=R[-18]C+1" Cells(m + 3, n + 2).FormulaR1C1 = "=""r_""&RC[-1]" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 4, n + 2).FormulaR1C1 = "w =" Cells(m + 4, n + 3).FormulaR1C1 = "=R11C7*POWER(R10C7,R[-1]C[-2]-1)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 2).FormulaR1C1 = "=SIN(RADIANS(R[-1]C[1]*R5C9))" Cells(m + 5, n + 3).FormulaR1C1 = "=1-COS(RADIANS(R[-1]C*R5C9))" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C+R[-16]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C+R[-4]C[4]*(R30C2*R30C1*R[-9]C[1]-R30C2*R30C2*R[-9]C+R30C3*R30C1*R[-9]C[2]-R30C3*R30C3*R[-9]C)+R[-4]C[3]*(R30C2*R[-9]C[2]-R30C3*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-9]C+R[-4]C[3]*(-R30C1*R30C1*R[-9]C+R30C1*R30C2*R[-9]C[-1]+R30C3*R30C2*R[-9]C[1]-R30C3*R30C3*R[-9]C)+R[-4]C[2]*(-R30C1*R[-9]C[1]+R30C3*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C+R[-4]C[2]*(-R30C1*R30C1*R[-9]C+R30C1*R30C3*R[-9]C[-2]-R30C2*R30C2*R[-9]C+R30C2*R30C3*R[-9]C[-1])+R[-4]C[1]*(R30C1*R[-9]C[-1]-R30C2*R[-9]C[-2])" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 = "1" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "9851952" Cells(m + 3, n + 1).Font.Size = "11" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "" Cells(m1 + 2, n1 - 1).Value = 11 End If ' vector ends If m = m1 + 90 Then ActiveSheet.DropDowns("List2").Select With Selection ' Do While .ListCount > 0 ' borrar lista .ListIndex = .ListCount .RemoveItem (.ListIndex) Loop i = 3 Do While Cells(m1 + i, n1 - 1) <> "" ' incluir todos los vectores a la lista .AddItem Cells(m1 + i, n1 - 1).Value i = i + 9 Loop End With Sheets("CONFIG").Range("V6").Value = "" Cells(m1 + 9, n1 + 4).Select Call DeleteGraphFunction Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub