Sub Project_18_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 18_Lens_EN ' Updated: 30/03/24 ' Created by: (22/11/23) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 18 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 = "2" 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 = " (22/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 = "1" 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 = "=IF(R[28]C[5]=1,"""",""Objeto"")" Cells(m1 + 3, n1 + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 = "=CONFIG!R6C5" 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 = "IMAGEN DE UNA LENTE CONVEXA Y DE UNA LENTE C" & ChrW(211) & "NCAVA" & Chr(10) & _ " El modelo muestra c" & ChrW(243) & "mo se puede construir la imagen en una lente de un objeto que tiene una posici" & ChrW(243) & "n y orientaci" & ChrW(243) & "n arbitrarias delante de la lente. " & Chr(10) & _ " Tanto el objeto como la imagen se representan con flechas. La construcci" & ChrW(243) & "n se hace por medio de dos haces que salen de la parte superior del objeto, uno de ellos pasa por un punto determinado de la lente y el otro por el origen. Al trasladar el primer haz paralelamente hasta el origen, este va a intersectarse con el plano focal de la lente en un punto determinado. Este punto de intersecci" & ChrW(243) & "n es por donde pasar" & ChrW(225) & " el primer haz y su proyecci" & ChrW(243) & "n hasta que se intersecte con el segundo haz (que pas" & ChrW(243) & " por el origen) determinar" & ChrW(225) & " el punto superior de la imagen. Para determinar el punto en donde inicia la imagen se procede de la misma manera con otros dos haces. " & Chr(10) & _ " " & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " IMAGE OF A CONVEX LENS AND A CONCAVE LENS" & Chr(10) & _ " The model shows how the image can be constructed in a lens of an object having an arbitrary position and orientation in front of the lens." & Chr(10) & _ " Both the object and the image are represented by arrows. The construction is carried out by means of two rays that come out of the upper part of the object, one of them passes through a certain point of the lens and the other through the origin. By translating the first ray parallel to the origin, it will intersect the focal plane of the lens at a certain point. This intersection point is where the first ray will pass and its projection to the intersection with the second ray (which passed through the origin) will determine the top point of the image. To determine the point where the image begins, proceed in the same way with two other rays." & Chr(10) & _ " Press the >> C button to view the system from different views." & Chr(10) & _ " You will observe how the image moves with the displacement of the focal length. Modify different parameters and observe the behavior of the lens. To return to the initial parameters, click Reset and reload the model." Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 17 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(R[28]C[5]=1,"""",""Objeto"")" Cells(m + 3, n + 2).FormulaR1C1 = "=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 = "=CONFIG!R6C5" Cells(m + 3, n + 4).FormulaR1C1 = "=CONFIG!R6C6" Cells(m + 3, n + 5).FormulaR1C1 = "15" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Image of a lens" Cells(m + 4, n + 12).FormulaR1C1 = "IMAGE OF A LENS" Cells(m + 4, n + 24).FormulaR1C1 = "INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0" Cells(m + 6, n + -1).FormulaR1C1 = "=SIN(RADIANS(R[13]C[6]))" Cells(m + 6, n + 0).FormulaR1C1 = "=COS(RADIANS(R[13]C[5]))" Cells(m + 7, n + -1).FormulaR1C1 = "=R[2]C[6]" Cells(m + 7, n + 0).FormulaR1C1 = "=R[3]C[5]" Cells(m + 7, n + 1).FormulaR1C1 = "=R[4]C[4]" Cells(m + 7, n + 4).FormulaR1C1 = "OBJECT|||||||||||||||||" Cells(m + 8, n + -1).FormulaR1C1 = "=SIN(RADIANS(R[5]C[6]))" Cells(m + 8, n + 0).FormulaR1C1 = "=COS(RADIANS(R[5]C[5]))" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "Position:" Cells(m + 8, n + 7).FormulaR1C1 = "LENS TYPE:" Cells(m + 8, n + 21).FormulaR1C1 = "To construct the image of an object that is in the same plane as the lens (YZ plane) and that is inclined at " Cells(m + 9, n + -1).FormulaR1C1 = "=R[3]C[6]*R[-1]C[1]*R[-3]C" Cells(m + 9, n + 0).FormulaR1C1 = "=R[3]C[5]*R[-1]C[-1]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[3]C[4]*R[-1]C[-1]*R[-3]C[-1]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = " x. =" Cells(m + 9, n + 5).FormulaR1C1 = "30" Cells(m + 9, n + 7).FormulaR1C1 = "=IF(R[11]C[-2]>0,"" C O N V E X "",IF(R[11]C[-2]<0, "" C O N C A V E "","" FLAT GLASS ""))" Cells(m + 9, n + 21).FormulaR1C1 = "a certain angle with respect to the vertical (cell G16), we proceed as follows:" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "=R[5]C[4]" Cells(m + 10, n + 4).FormulaR1C1 = " y =" Cells(m + 10, n + 5).FormulaR1C1 = "-100" Cells(m + 10, n + 21).FormulaR1C1 = "for convex lens:" Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = " z =" Cells(m + 11, n + 5).FormulaR1C1 = "0" Cells(m + 11, n + 21).FormulaR1C1 = "Two beams of light are taken coming out of the head of the object, one passing through the center of the " Cells(m + 3, n + 1).Interior.Color = "13434777" 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 16 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(R[19]C[5]=1,"""",""Imagen"")" Cells(m + 3, n + 1).FormulaR1C1 = "_120" Cells(m + 3, n + 4).FormulaR1C1 = "Height =" Cells(m + 3, n + 5).FormulaR1C1 = "40" Cells(m + 3, n + 21).FormulaR1C1 = "lens and the other directed to the lens and meeting it at a given height (cell G25). The direction of the first " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "Inclination:" Cells(m + 4, n + 5).FormulaR1C1 = "=R[-11]C[2]" Cells(m + 4, n + 21).FormulaR1C1 = "beam does not change after passing through the lens. To determine the path of the second beam, an " 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 + 4).FormulaR1C1 = "FIX PATH|||||||" Cells(m + 5, n + 21).FormulaR1C1 = "auxiliary optical axis (G32) is drawn parallel to the beam and passes through the center of the lens, " Cells(m + 6, n + 4).FormulaR1C1 = "YES=2, NO=1" Cells(m + 6, n + 5).FormulaR1C1 = "1" Cells(m + 6, n + 21).FormulaR1C1 = "projecting it towards the focal plane. The point of intersection of the auxiliary axis with the focal plane " Cells(m + 7, n + -1).FormulaR1C1 = "=R[90]C+R[92]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[90]C+R[92]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[90]C+R[92]C" Cells(m + 7, n + 21).FormulaR1C1 = "is the auxiliary focus, through which the second beam must pass after its refraction in the lens. These two " Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "SYSTEM|||||||||||||||||" Cells(m + 8, n + 21).FormulaR1C1 = "beams meet at a point, which is the point where the image head is located. We proceed in the same " Cells(m + 9, n + -1).FormulaR1C1 = "=-R[90]C+R[63]C+R[-9]C" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[90]C+R[63]C+R[-9]C" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[90]C+R[63]C+R[-9]C" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 = "High lens:" Cells(m + 9, n + 5).FormulaR1C1 = "150" Cells(m + 9, n + 21).FormulaR1C1 = "way to find the tail of the image." Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "=R[-4]C[4]" Cells(m + 10, n + 4).FormulaR1C1 = "Angle included:" Cells(m + 10, n + 5).FormulaR1C1 = "0" Cells(m + 10, n + 21).FormulaR1C1 = "In the case of the concave lens, the beam construction process is similar, with the difference that the " Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "Focal distance:" Cells(m + 11, n + 5).FormulaR1C1 = "50" Cells(m + 11, n + 21).FormulaR1C1 = "beam that goes parallel to the auxiliary axis, after refracting in the lens, continues in such a way" Cells(m + 3, n + 1).Interior.Color = "49407" 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 + 18 Then ' vector 15 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 4).FormulaR1C1 = "Beam-lens crossing height:" Cells(m + 3, n + 21).FormulaR1C1 = "that its extension passes through the auxiliary focus, the latter being the intersection of the focal plane " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "Height:" Cells(m + 4, n + 5).FormulaR1C1 = "50" Cells(m + 4, n + 21).FormulaR1C1 = "with the auxiliary axis (as in the previous case)." 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 + 4).FormulaR1C1 = "Beam thickness (0 -5):" Cells(m + 6, n + 4).FormulaR1C1 = "Ray 1:" Cells(m + 6, n + 5).FormulaR1C1 = "1" Cells(m + 6, n + 21).FormulaR1C1 = "EXAMPLE OF CONVEX LENS:" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 0).FormulaR1C1 = "0" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 4).FormulaR1C1 = "Ray 2:" Cells(m + 7, n + 5).FormulaR1C1 = "1" Cells(m + 7, n + 22).FormulaR1C1 = "Focal distance:" Cells(m + 7, n + 25).FormulaR1C1 = "G23 = 50" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "||||||||||||||||||||||||" Cells(m + 8, n + 22).FormulaR1C1 = "Object position:" Cells(m + 8, n + 25).FormulaR1C1 = "G13 = -100" Cells(m + 8, n + 26).FormulaR1C1 = "(real image)" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-9]C[6]*R[-21]C" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-9]C[4]*R[-21]C[-1]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 22).FormulaR1C1 = "Object position:" Cells(m + 9, n + 25).FormulaR1C1 = "G13 = -20" Cells(m + 9, n + 26).FormulaR1C1 = "(virtual image)" 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 = "SHOW (YES=0, NO=1):" Cells(m + 10, n + 22).FormulaR1C1 = "Auxiliary axle:" Cells(m + 10, n + 25).FormulaR1C1 = "G32 = 0" Cells(m + 10, n + 26).FormulaR1C1 = "(0= show, 1= hide auxiliary axis)" Cells(m + 11, n + -1).FormulaR1C1 = "=IF(R23C7<0,5,3)" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "2" Cells(m + 11, n + 4).FormulaR1C1 = "Auxiliary axis:" Cells(m + 11, n + 5).FormulaR1C1 = "1" Cells(m + 11, n + 22).FormulaR1C1 = "Focal plane:" Cells(m + 11, n + 25).FormulaR1C1 = "G33=0" Cells(m + 11, n + 26).FormulaR1C1 = "(0= show, 1= hide focal plane)" Cells(m + 3, n + 1).Interior.Color = "65535" 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 14 Cells(m + 3, n + -1).FormulaR1C1 = "4" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(R[1]C[5]=1,"""",""Lente"")" Cells(m + 3, n + 4).FormulaR1C1 = "Focal plane:" Cells(m + 3, n + 5).FormulaR1C1 = "0" Cells(m + 3, n + 22).FormulaR1C1 = "Tags:" Cells(m + 3, n + 25).FormulaR1C1 = "G34=0" Cells(m + 3, n + 26).FormulaR1C1 = "(0= show, 1= hide labels)" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "Tags:" Cells(m + 4, n + 5).FormulaR1C1 = "1" 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 + 21).FormulaR1C1 = "Press the simulation run buttons to see the image with different inclinations of the object. Press " Cells(m + 6, n + 21).FormulaR1C1 = "G18 =2 (check that G16=I5) and press run to freeze the path of both the object and the image." 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 + 8, n + 21).FormulaR1C1 = "EXAMPLE OF CONCAVE LENS:" Cells(m + 9, n + -1).FormulaR1C1 = "=-R[-9]C" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-9]C" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[-9]C" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 22).FormulaR1C1 = "Focal distance:" Cells(m + 9, n + 25).FormulaR1C1 = "G23 = -50" 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 + 22).FormulaR1C1 = "Object position:" Cells(m + 10, n + 25).FormulaR1C1 = "G13 = -100" Cells(m + 11, n + -1).FormulaR1C1 = "=IF(R23C7<0,5,3)" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "=R[-9]C" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 22).FormulaR1C1 = "Auxiliary axle:" Cells(m + 11, n + 25).FormulaR1C1 = "G32 = 0" Cells(m + 11, n + 26).FormulaR1C1 = "(0= show, 1= hide auxiliary axis)" Cells(m + 3, n + 1).Interior.Color = "65535" 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 13 Cells(m + 3, n + -1).FormulaR1C1 = "5" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(R[-8]C[5]=1,"""",""Plano focal"")" Cells(m + 3, n + 2).FormulaR1C1 = "6" Cells(m + 3, n + 3).FormulaR1C1 = "0" Cells(m + 3, n + 22).FormulaR1C1 = "Focal plane:" Cells(m + 3, n + 25).FormulaR1C1 = "G33=0" Cells(m + 3, n + 26).FormulaR1C1 = "(0= show, 1= hide focal plane)" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 22).FormulaR1C1 = "Tags:" Cells(m + 4, n + 25).FormulaR1C1 = "G34=0" Cells(m + 4, n + 26).FormulaR1C1 = "(0= show, 1= hide labels)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "6" Cells(m + 5, n + 1).FormulaR1C1 = "=R[-11]C[4]" Cells(m + 6, n + -1).FormulaR1C1 = "t=" Cells(m + 6, n + 21).FormulaR1C1 = "Press the simulation run buttons to view the image of different inclinations of the object" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C+R[-23]C[5]" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 21).FormulaR1C1 = "(check that G16=I5)." Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-18]C" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-18]C" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "To experiment different focal lengths consecutively, set G16 = 0 and G23 =I5-50 (cell I5 is the counter). " 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 = "Verify that G18 = 1. Press the Run button or the buttons next to it to analyze different focal planes." 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 = "16777215" 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 12 Cells(m + 3, n + -1).FormulaR1C1 = "6" Cells(m + 3, n + 2).FormulaR1C1 = "1" Cells(m + 3, n + 3).FormulaR1C1 = "0" Cells(m + 3, n + 21).FormulaR1C1 = "You can press XYZ and the C button to rotate the entire optical system 360 degrees." Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "(The equations with which the model was built are analyzed in the ScienSolar books.)" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "6" Cells(m + 5, n + 1).FormulaR1C1 = "=R[-20]C[4]" Cells(m + 6, n + -1).FormulaR1C1 = "t=" 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" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-9]C" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[-9]C" 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 = "1" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16777215" 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 11 Cells(m + 3, n + -1).FormulaR1C1 = "7" 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 = "=R[-11]C[2]" Cells(m + 5, n + 2).FormulaR1C1 = "2" Cells(m + 5, n + 3).FormulaR1C1 = "0" Cells(m + 6, n + 0).FormulaR1C1 = "=(R[-35]C-R[-53]C-R[-33]C/R[-33]C[1]*(R[-35]C[1]-R[-53]C[1]))/(R[3]C-R[-33]C*R[3]C[1]/R[-33]C[1])" Cells(m + 6, n + 2).FormulaR1C1 = "3" Cells(m + 6, n + 3).FormulaR1C1 = "0" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 7, n + 2).FormulaR1C1 = "4" Cells(m + 7, n + 3).FormulaR1C1 = "0" Cells(m + 8, n + 2).FormulaR1C1 = "5" Cells(m + 8, n + 3).FormulaR1C1 = "0" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-41]C[6]*R[-57]C-R[-54]C" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-56]C-R[-54]C" Cells(m + 9, n + 1).FormulaR1C1 = "=(R[-41]C[4]+1)*R[-57]C[-1]-R[-54]C-R[-56]C" 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 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "=R27C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "15773696" 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 10 Cells(m + 3, n + -1).FormulaR1C1 = "8" 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 = "=R[-9]C[2]" Cells(m + 7, n + -1).FormulaR1C1 = "=R[54]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[54]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[54]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[54]C*R126C2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[54]C*R126C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[54]C*R126C2" 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 = "=R27C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "15773696" 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 9 Cells(m + 3, n + -1).FormulaR1C1 = "9" 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 = "=R[-17]C[2]" Cells(m + 7, n + -1).FormulaR1C1 = "=R[54]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[54]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[54]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[54]C*R128C2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[54]C*R128C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[54]C*R128C2" 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 = "=R27C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "15773696" 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 8 Cells(m + 3, n + -1).FormulaR1C1 = "10" 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 = "=R[-25]C[2]" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-81]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-81]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-81]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-27]C*R63C2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-27]C*R63C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-27]C*R63C2" 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 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "=R28C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16777215" 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 7 Cells(m + 3, n + -1).FormulaR1C1 = "11" 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 = "=R[-33]C[2]" Cells(m + 7, n + -1).FormulaR1C1 = "=R[45]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[45]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[45]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[45]C*R144C2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[45]C*R144C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[45]C*R144C2" 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 = "=R28C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16777215" 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 + 99 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 = "12" 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 = "=R[-65]C[2]" Cells(m + 7, n + -1).FormulaR1C1 = "=R[45]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[45]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[45]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[45]C*R146C2+0.001" Cells(m + 9, n + 0).FormulaR1C1 = "=R[45]C*R146C2+0.001" Cells(m + 9, n + 1).FormulaR1C1 = "=R[45]C*R146C2+0.001" 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 = "=R28C7" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "16777215" 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 + 108 Then ' vector 5 Cells(m + 3, n + -1).FormulaR1C1 = "13" Cells(m + 3, n + 0).FormulaR1C1 = "=IF(R[-80]C[5]=1,"""",""Eje auxiliar"")" 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 = "6" Cells(m + 5, n + 1).FormulaR1C1 = "=R[-84]C[4]" Cells(m + 6, n + 0).FormulaR1C1 = "=(R[-94]C[5]-R[-89]C-R[-87]C/R[-87]C[1]*(R[-89]C[1]-R[-107]C[1]))/(R[-51]C-R[-87]C*R[-51]C[1]/R[-87]C[1])" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-90]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-90]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-90]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-54]C*R117C2" Cells(m + 9, n + 0).FormulaR1C1 = "=R[-54]C*R117C2" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-54]C*R117C2" 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 = "16777215" 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 = "AUX1" Call AddNewVector End If ' vector ends If m = m1 + 117 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 = "0" Cells(m + 3, n + 0).FormulaR1C1 = "AUX1" 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 + 6, n + -1).FormulaR1C1 = "t=" Cells(m + 6, n + 0).FormulaR1C1 = "=(R[10]C-R[1]C-R[12]C/R[12]C[1]*(R[10]C[1]-R[1]C[1]))/(R[3]C-R[12]C*R[3]C[1]/R[12]C[1])" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-63]C+R[-61]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-63]C+R[-61]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-63]C+R[-61]C" Cells(m + 8, n + -1).FormulaR1C1 = "s=" Cells(m + 8, n + 0).FormulaR1C1 = "=R[-1]C[1]/R[10]C[1]-R[8]C[1]/R[10]C[1]+R[1]C[1]/R[10]C[1]*R[-2]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=(-R[-104]C[6]*R[-120]C+R[-9]C)" Cells(m + 9, n + 0).FormulaR1C1 = "=(R[-99]C+R[-9]C)" Cells(m + 9, n + 1).FormulaR1C1 = "=(-(R[-104]C[4]+1)*R[-120]C[-1]+R[-9]C)" 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 = "4" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "5287936" 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 = "AUX2" Call AddNewVector End If ' vector ends If m = m1 + 126 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "0" Cells(m + 3, n + 0).FormulaR1C1 = "AUX2" 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[-126]C+R[-124]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-126]C+R[-124]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-126]C+R[-124]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=(-R[-126]C)" Cells(m + 9, n + 0).FormulaR1C1 = "=(-R[-2]C)" Cells(m + 9, n + 1).FormulaR1C1 = "=(-R[-2]C+0.01)" 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 = "3" 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 = "5287936" 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 = "AUX3" Call AddNewVector End If ' vector ends If m = m1 + 135 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "0" Cells(m + 3, n + 0).FormulaR1C1 = "AUX3" 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 + 6, n + -1).FormulaR1C1 = "t=" Cells(m + 6, n + 0).FormulaR1C1 = "=(R[10]C-R[1]C-R[12]C*POWER(R[12]C[1],-1)*(R[10]C[1]-R[1]C[1]))/(R[3]C-R[12]C*R[3]C[1]*POWER(R[12]C[1],-1))" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-54]C+R[-52]C" Cells(m + 8, n + -1).FormulaR1C1 = "s=" Cells(m + 8, n + 0).FormulaR1C1 = "=R[-1]C[1]/R[10]C[1]-R[8]C[1]/R[10]C[1]+R[1]C[1]/R[10]C[1]*R[-2]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=-R[-54]C+R[-135]C+R[-81]C+R[-18]C" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-54]C+R[-135]C+R[-81]C+R[-18]C" Cells(m + 9, n + 1).FormulaR1C1 = "=-R[-54]C+R[-135]C+R[-81]C+R[-18]C" 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 = "3" 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 = "16777215" 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 = "AUX4" Call AddNewVector End If ' vector ends If m = m1 + 144 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "0" Cells(m + 3, n + 0).FormulaR1C1 = "AUX4" 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[-144]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-144]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-144]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=(R[-144]C-R[-144]C)" Cells(m + 9, n + 0).FormulaR1C1 = "=(R[-144]C-R[-20]C)" Cells(m + 9, n + 1).FormulaR1C1 = "=(R[-144]C-R[-20]C)+0.0001" 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 = "3" 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 = "16777215" 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 = 17 End If ' vector ends If m = m1 + 144 Then Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub