Sub Project_8_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 08_Rotacion compuesta_ES ' 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 = "Rotaci" & ChrW(243) & "n compuesta" Cells(m + 4, n + 12).FormulaR1C1 = "ROTACI" & ChrW(211) & "N COMPUESTA " Cells(m + 4, n + 23).FormulaR1C1 = "INSTRUCCIONES" 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 = "El presente modelo se basa en el modelo ROTACI" & ChrW(211) & "N DE UN VECTOR y se extiende para varios vectores " 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 = "cuyo n" & ChrW(250) & "mero puede aumentarse. Cada vector se somete a la matr" & ChrW(237) & "z de rotaci" & ChrW(243) & "n:" 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 = "Cantidad de vectores:" 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 = "Para trazar el recorrido de un vector:" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "186" Cells(m + 4, n + 2).FormulaR1C1 = "1. M" & ChrW(225) & "x. pasos = longitud del gr" & ChrW(225) & "fico." 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. Haga clic en Restablecer gr" & ChrW(225) & "fico." Cells(m + 6, n + -1).FormulaR1C1 = "Choose the vector to make its graphic:" Cells(m + 6, n + 2).FormulaR1C1 = "3. Elija en el cuadro combinado un vector impar." 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. Ejecute la simulaci" & ChrW(243) & "n." Cells(m + 7, n + 21).FormulaR1C1 = "en donde el " & ChrW(225) & "ngulo puede variar con el par" & ChrW(225) & "metro 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 = "y a su vez w puede tomar cualquier forma, que en este caso particular:" 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 y P son par" & ChrW(225) & "metros que dependen del n" & ChrW(250) & "mero del vector.Modifique el valor de estos " 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 = "par" & ChrW(225) & "metros en las celdas G10 y G11. La orientaci" & ChrW(243) & "n inicial de los vectores y sus coordenadas " Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "se pueden personalizar en las filas 39, 57, 75 y 93 respectivamente para cada 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 = "Oprima Ejecutar para visualizar la simulaci" & ChrW(243) & "n. Cambie los par" & ChrW(225) & "metros K y P para obtener " 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 = "diferentes configurraciones." 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 = "Se pueden dibujar las trayectorias de los vectores impares. Para dibujar la trayectoria del" 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 seleccione este vector en la lista ubicada en C19 y oprima Ejecutar." 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 = "Para agregar o quitar vectores adicionales al modelo utilice los botones +OBJ y -OBJ." 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