Sub Project_19_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 19_3D Pyramid_EN ' Updated: 30/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 19 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 = "60" Cells(m1 + 0, n1 + 1).FormulaR1C1 = "77" 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 = "8" 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 = "Height:" Cells(m1 + 2, n1 + 7).FormulaR1C1 = "0" Cells(m1 + 3, n1 + 0).FormulaR1C1 = "h" 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 = "375" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "PIR" & ChrW(193) & "MIDE SOBRE BASE DE 6 ARISTAS" & Chr(10) & _ " Modifique la altura en la celda I5 y oprima el bot" & ChrW(243) & "n de la celda F3 para ver resultados. Las dimensiones de la base se modifican en la celda H6. El " & ChrW(225) & "ngulo interno entre las aristas de la base se establece en la celda I6 = 60 grados. Con el bot" & ChrW(243) & "n Run puede simular el cambio de altura desde el valor indicado en I5 un n" & ChrW(250) & "mero de veces indicado en I4 cada vez incrementando o disminuyendo en el valor indicado en I3. El bot" & ChrW(243) & "n Selected hace el mismo trabajo pero con el valor de cualquier otra celda." & Chr(10) & _ " Por ejemplo, ponga los valores I3=1, I4 = 60, I6 = 0, y deje seleccionada la celda I6, presione Selected y observar" & ChrW(225) & " que la pir" & ChrW(225) & "mide desarmada se compondr" & ChrW(225) & " al cabo de 60 pasos. " & Chr(10) & _ " Ejemplo 2, ponga los valores I3 = -0,5, I4 = 60 , H6 = 5, y deje seleccionada la celda H6, presione Selected y observar" & ChrW(225) & " que la pir" & ChrW(225) & "mide ir" & ChrW(225) & " cambiando el tama" & ChrW(233) & "o de su base durante 60 pasos" & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " PYRAMID ON A 6-EDGE BASE" & Chr(10) & _ " Modify the height in cell I5 and press the button in cell F3 to see the results. The base dimensions are changed in cell H6. The internal angle between the edges of the base is set in cell I6 = 60 degrees. With the Run button you can simulate the change in height from the value indicated in I5 a number of times indicated in I4 by increasing or decreasing each time the value indicated in I3. The Selected button does the same but with the value of any other cell." & Chr(10) & _ " For example, put the values " & ChrW(233) & "" & ChrW(233) & "I3=1, I4=60, I6=0, and leave cell I6 selected, press Selected and you will see that the disassembled pyramid will be composed after 60 steps." & Chr(10) & _ " Example 2, put the values " & ChrW(233) & "" & ChrW(233) & "I3=-0.5, I4=60, H6=5, and leave cell H6 selected, press Selected and you will see that the pyramid will change the size of its base by 60 steps" & Chr(10) & _ " " & Chr(10) & _ " " Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 10 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "h" 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 = "375" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "3D pyramid" Cells(m + 4, n + 12).FormulaR1C1 = "n-ANGULAR PYRAMID" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "8" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + 4).FormulaR1C1 = "|||||||||||||||||||||||" Cells(m + 7, n + -1).FormulaR1C1 = "=R[6]C[6]" Cells(m + 7, n + 0).FormulaR1C1 = "=R[7]C[5]" Cells(m + 7, n + 1).FormulaR1C1 = "=R[8]C[4]+R[4]C[4]" Cells(m + 7, n + 4).FormulaR1C1 = "INITIAL DATA:" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "Base side:" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[2]C[4]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "L =" Cells(m + 9, n + 5).FormulaR1C1 = "5" Cells(m + 9, n + 21).FormulaR1C1 = "The simulation allows us to characterize any pyramid that has as its base a polygon with equal and " 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 = "Height:" Cells(m + 10, n + 21).FormulaR1C1 = "any number of sides. The initial parameters that must be entered are:" Cells(m + 11, n + -1).FormulaR1C1 = "5" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "h =" Cells(m + 11, n + 5).FormulaR1C1 = "=R[-9]C[2]/(-R[-11]C[2]*10)+9" Cells(m + 3, n + 1).Interior.Color = "255" 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 + 9 Then ' vector 9 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 4).FormulaR1C1 = "POSITION" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "x =" Cells(m + 4, n + 5).FormulaR1C1 = "5" Cells(m + 4, n + 21).FormulaR1C1 = "Base side:" Cells(m + 4, n + 23).FormulaR1C1 = "G12" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 4).FormulaR1C1 = "y =" Cells(m + 5, n + 5).FormulaR1C1 = "5" Cells(m + 5, n + 21).FormulaR1C1 = "Pyramid height:" Cells(m + 5, n + 23).FormulaR1C1 = "G14 " Cells(m + 5, n + 24).FormulaR1C1 = "(Press Run to consecutively change the pyramide height)" Cells(m + 6, n + 4).FormulaR1C1 = "z =" Cells(m + 6, n + 5).FormulaR1C1 = "0" Cells(m + 6, n + 21).FormulaR1C1 = "Center position of the base:" Cells(m + 6, n + 23).FormulaR1C1 = "G16, G17, G18." 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 + 7, n + 4).FormulaR1C1 = "|||||||||||||||||||||||" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[5]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "|||||||||||||||||||||||" Cells(m + 8, n + 21).FormulaR1C1 = "Pyramid type (triangular, square, pentagonal, etc): Use the +OBJ and -OBJ buttons to add or remove" Cells(m + 9, n + -1).FormulaR1C1 = "=R[9]C-R[27]C/2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[9]C-R[27]C/2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[9]C" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[4]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "RESULTS:" Cells(m + 9, n + 21).FormulaR1C1 = "faces to the pyramid." 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 = "N =" Cells(m + 10, n + 5).FormulaR1C1 = "=COUNTIF(C[-3],""TRG_*"")" 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 = "b =" Cells(m + 11, n + 5).FormulaR1C1 = "=SQRT(R[-9]C^2+R[7]C^2)" Cells(m + 11, n + 6).FormulaR1C1 = "(Eq-19-b)" Cells(m + 11, n + 21).FormulaR1C1 = "The result parameters that characterize the pyramid are:" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "d" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 8 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 0).FormulaR1C1 = "d" Cells(m + 3, n + 4).FormulaR1C1 = "a =" Cells(m + 3, n + 5).FormulaR1C1 = "=SQRT(R[15]C[-6]^2+R[15]C[-5]^2+R[15]C[-4]^2)" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "V =" Cells(m + 4, n + 5).FormulaR1C1 = "=ABS(R[8]C*R[-11]C/3)" Cells(m + 4, n + 6).FormulaR1C1 = "(Eq-19-V)" Cells(m + 4, n + 23).FormulaR1C1 = "G22" Cells(m + 4, n + 24).FormulaR1C1 = "N" Cells(m + 4, n + 25).FormulaR1C1 = "Number of lateral faces of the pyramid." Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 23).FormulaR1C1 = "G23" Cells(m + 5, n + 24).FormulaR1C1 = "b" Cells(m + 5, n + 25).FormulaR1C1 = "Length of the vertical edge." Cells(m + 6, n + 4).FormulaR1C1 = "BASE:" Cells(m + 6, n + 23).FormulaR1C1 = "G24" Cells(m + 6, n + 24).FormulaR1C1 = "a" Cells(m + 6, n + 25).FormulaR1C1 = "Apothem." 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 + 7, n + 4).FormulaR1C1 = "alpha =" Cells(m + 7, n + 5).FormulaR1C1 = "=180-R[1]C" Cells(m + 7, n + 6).FormulaR1C1 = "(Eq-19-a)" Cells(m + 7, n + 23).FormulaR1C1 = "G25" Cells(m + 7, n + 24).FormulaR1C1 = "V" Cells(m + 7, n + 25).FormulaR1C1 = "Volume." Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-13]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "theta =" Cells(m + 8, n + 5).FormulaR1C1 = "=360/R[-7]C" Cells(m + 8, n + 6).FormulaR1C1 = "(Eq-19-t)" Cells(m + 8, n + 22).FormulaR1C1 = "BASE:" Cells(m + 9, n + -1).FormulaR1C1 = "=-R[-18]C-R[27]C" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-18]C-R[27]C" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[-18]C-R[27]C" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-14]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "d =" Cells(m + 9, n + 5).FormulaR1C1 = "=R[-18]C/(2*COS(RADIANS((180-R[-1]C)/2)))" Cells(m + 9, n + 6).FormulaR1C1 = "(Eq-19-d)" Cells(m + 9, n + 23).FormulaR1C1 = "G28" Cells(m + 9, n + 24).FormulaR1C1 = "alpha" Cells(m + 9, n + 25).FormulaR1C1 = "Interior angle between face and face." 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 = "a_base =" Cells(m + 10, n + 5).FormulaR1C1 = "=SQRT(R[-10]C[-6]^2+R[-10]C[-5]^2)" Cells(m + 10, n + 23).FormulaR1C1 = "G29" Cells(m + 10, n + 24).FormulaR1C1 = "theta" Cells(m + 10, n + 25).FormulaR1C1 = "Exterior angle of advance of each face." 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 = "P =" Cells(m + 11, n + 5).FormulaR1C1 = "=R[-10]C*R[-20]C" Cells(m + 11, n + 6).FormulaR1C1 = "(Eq-19-P)" Cells(m + 11, n + 23).FormulaR1C1 = "G30" Cells(m + 11, n + 24).FormulaR1C1 = "d" Cells(m + 11, n + 25).FormulaR1C1 = "Distance from one of the vertices to the center." Cells(m + 3, n + 1).Interior.Color = "255" 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 + 27 Then ' vector 7 Cells(m + 3, n + -1).FormulaR1C1 = "4" Cells(m + 3, n + 0).FormulaR1C1 = "a" Cells(m + 3, n + 4).FormulaR1C1 = "S =" Cells(m + 3, n + 5).FormulaR1C1 = "=R[-1]C*R[-2]C/2" Cells(m + 3, n + 6).FormulaR1C1 = "(Eq-19-S)" Cells(m + 3, n + 23).FormulaR1C1 = "G31" Cells(m + 3, n + 24).FormulaR1C1 = "a_base" Cells(m + 3, n + 25).FormulaR1C1 = "Apothem of the base." Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "|||||||||||||||||||||||" Cells(m + 4, n + 23).FormulaR1C1 = "G32" Cells(m + 4, n + 24).FormulaR1C1 = "P" Cells(m + 4, n + 25).FormulaR1C1 = "Base perimeter." Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 5, n + 23).FormulaR1C1 = "G33" Cells(m + 5, n + 24).FormulaR1C1 = "S" Cells(m + 5, n + 25).FormulaR1C1 = "Base area." 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 + 7, n + 21).FormulaR1C1 = "The formulas to calculate some of these parameters are shown in the simulation through their" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "NOTE:" Cells(m + 8, n + 21).FormulaR1C1 = " respective buttons." Cells(m + 9, n + -1).FormulaR1C1 = "=R[-27]C-R[-18]C" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-27]C-R[-18]C" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-29]C-R[-21]C[4]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "PLEASE" 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 = "READ THE INSTRUCTIONS" 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 = "TO ADD OR REMOVE" Cells(m + 3, n + 1).Interior.Color = "255" 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 = "L" Call AddNewVector End If ' vector ends If m = m1 + 36 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 = "5" Cells(m + 3, n + 0).FormulaR1C1 = "L" Cells(m + 3, n + 1).FormulaR1C1 = "=(RC[-2]-1)/2-1" Cells(m + 3, n + 2).FormulaR1C1 = "=""TRG_""&RC[-1]" Cells(m + 3, n + 4).FormulaR1C1 = "NEW FACES." 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 = "0" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-36]C+R[-34]C-R[-16]C[6]*SIN(RADIANS((180-R[-17]C[6])/2))" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-36]C+R[-34]C+R[-16]C[5]*COS(RADIANS((180-R[-17]C[5])/2))" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-36]C+R[-34]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R12C7*SIN(RADIANS(R29C7*R[-6]C[2]))" Cells(m + 9, n + 0).FormulaR1C1 = "=R12C7*COS(RADIANS(R29C7*R[-6]C[1]))" Cells(m + 9, n + 1).FormulaR1C1 = "0" 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 = "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 = "2315831" 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 = "b" Call AddNewVector End If ' vector ends If m = m1 + 45 Then ' vector 5 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 = "b" 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 = "0" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R30C7*SIN(RADIANS(R29C7*(R[-15]C[2]+1)+(180-R29C7)/2))" Cells(m + 9, n + 0).FormulaR1C1 = "=R30C7*COS(RADIANS(R29C7*(R[-15]C[1]+1)+(180-R29C7)/2))" Cells(m + 9, n + 1).FormulaR1C1 = "=R14C7" 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 = "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 = "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 + 54 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 1).FormulaR1C1 = "=(RC[-2]-1)/2-1" Cells(m + 3, n + 2).FormulaR1C1 = "=""TRG_""&RC[-1]" 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 = "0.3" 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 + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R12C7*SIN(RADIANS(R29C7*R[-6]C[2]))" Cells(m + 9, n + 0).FormulaR1C1 = "=R12C7*COS(RADIANS(R29C7*R[-6]C[1]))" Cells(m + 9, n + 1).FormulaR1C1 = "0" 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 = "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 = "2315831" 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 3 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" 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 = "0" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R30C7*SIN(RADIANS(R29C7*(R[-15]C[2]+1)+(180-R29C7)/2))" Cells(m + 9, n + 0).FormulaR1C1 = "=R30C7*COS(RADIANS(R29C7*(R[-15]C[1]+1)+(180-R29C7)/2))" Cells(m + 9, n + 1).FormulaR1C1 = "=R14C7" 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 = "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 = "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 + 72 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 1).FormulaR1C1 = "=(RC[-2]-1)/2-1" Cells(m + 3, n + 2).FormulaR1C1 = "=""TRG_""&RC[-1]" 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 = "0.3" 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 + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R12C7*SIN(RADIANS(R29C7*R[-6]C[2]))" Cells(m + 9, n + 0).FormulaR1C1 = "=R12C7*COS(RADIANS(R29C7*R[-6]C[1]))" Cells(m + 9, n + 1).FormulaR1C1 = "0" 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 = "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 = "2315831" 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 1 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" 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 = "0" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-9]C+R[-7]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R30C7*SIN(RADIANS(R29C7*(R[-15]C[2]+1)+(180-R29C7)/2))" Cells(m + 9, n + 0).FormulaR1C1 = "=R30C7*COS(RADIANS(R29C7*(R[-15]C[1]+1)+(180-R29C7)/2))" Cells(m + 9, n + 1).FormulaR1C1 = "=R14C7" 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 = "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 = "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 = 10 End If ' vector ends If m = m1 + 81 Then Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub