Sub Project_26_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 26_Magnetic Force_EN ' Updated: 6/04/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 26 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 + 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 = "40" 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 = "dl_1" 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 = "MAGNETIC FORCE BETWEEN TWO CURRENT ELEMENTS" & Chr(10) & _ " The objective of this model is to analyze Ampere's law for the interaction between currents." & Chr(10) & _ " Moving electric charges generate a magnetic field around them. On the other hand, a moving charge in an external magnetic field experiences a force. From these two statements, we can say that two current-carrying wires can experience interaction forces. At the beginning of the 19th century, the French physicist Andre-Marie Ampere studied this interaction between currents in depth and, in the case of two infinitesimal current elements, established the interaction force, being" & Chr(10) & _ " dF12 =K I1 I2 dL2 x [dL1 x r12]/r12^3" & Chr(10) & _ " the magnetic force of stream 1 on stream 2 and" & Chr(10) & _ " dF21 =K I1 I2 dL1 x [dL2 x r21]/ r21^3" & Chr(10) & _ " the magnetic force of 2 over 1; I1 and I2 are the currents, dL1 and dL2 are vectors representing infinitesimal lengths of wires that carry these currents, r12 is the distance from I1 to I2, r21 is the distance from I2 to I1, K is a constant that depends on the system of units. The equation described above is a double cross product. " & Chr(10) & _ " From this equation, the magnetic force of one current on the other can be drawn in three dimensions, from the magnitudes (cells G14 and G15), the direction (A12, B12, C12 and A30, B30, C30), of the currents and the distance r that separates them (A21, B21, C21). Modify these values " & ChrW(233) & "" & ChrW(233) & "as needed and observe the behavior of the forces. Explain why in some cases Newton's third law does not seem to be fulfilled." & Chr(10) & _ " " Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 7 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "dl_1" 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 + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Magnetic Force - Ampere's Law" Cells(m + 4, n + 12).FormulaR1C1 = "MAGNETIC FORCE BETWEEN TWO CURRENT ELEMENTS" 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 + 4).FormulaR1C1 = "Constant:" Cells(m + 7, n + -1).FormulaR1C1 = "3" Cells(m + 7, n + 0).FormulaR1C1 = "2" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "<<-- Position of dL_1." Cells(m + 7, n + 4).FormulaR1C1 = " K =" Cells(m + 7, n + 5).FormulaR1C1 = "2" Cells(m + 8, n + -1).FormulaR1C1 = "Alambre 1" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "The objective of this model is to analyze Ampere's law for the interaction between currents. " Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "-1" Cells(m + 9, n + 2).FormulaR1C1 = "<<-- Coordinates of vector dL_1." Cells(m + 9, n + 21).FormulaR1C1 = "Moving electric charges generate a magnetic field around them. On the other hand, a charge moving " 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 = "Current intensity:" Cells(m + 10, n + 21).FormulaR1C1 = "in an external magnetic field experiences a force. From these two statements we can then say " Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "3" Cells(m + 11, n + 4).FormulaR1C1 = " I_1 = " Cells(m + 11, n + 5).FormulaR1C1 = "2" Cells(m + 11, n + 21).FormulaR1C1 = "that two wires that have currents can experience interaction forces. At the beginning of the 19th " Cells(m + 3, n + 1).Interior.Color = "12611584" 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 = "r" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "r" Cells(m + 3, n + 4).FormulaR1C1 = " I_2 = " Cells(m + 3, n + 5).FormulaR1C1 = "3" Cells(m + 3, n + 21).FormulaR1C1 = "century, the French physicist Andre-Marie Ampere studied this interaction between currents " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "in depth and in the case of two infinitesimal current elements, the interaction force was established" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "4" Cells(m + 5, n + 1).FormulaR1C1 = "0,3" Cells(m + 5, n + 4).FormulaR1C1 = "RESULT:" Cells(m + 5, n + 21).FormulaR1C1 = "being" Cells(m + 6, n + -1).FormulaR1C1 = "K i1i2/r^3 =" Cells(m + 6, n + 0).FormulaR1C1 = "=R[-8]C[5]*R[-4]C[5]*R[-3]C[5]/POWER(SQRT(R[3]C[-1]^2+R[3]C^2+R[3]C[1]^2),3)" Cells(m + 6, n + 4).FormulaR1C1 = " |r| = " Cells(m + 6, n + 5).FormulaR1C1 = "=SQRT(R[3]C[-6]^2+R[3]C[-5]^2+R[3]C[-4]^2)" 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 = " |dF12| = " Cells(m + 7, n + 5).FormulaR1C1 = "=SQRT(R[29]C[-6]^2+R[29]C[-5]^2+R[29]C[-4]^2)" Cells(m + 7, n + 27).FormulaR1C1 = "(Eq-26-1)" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = " |dF21| = " Cells(m + 8, n + 5).FormulaR1C1 = "=SQRT(R[46]C[-6]^2+R[46]C[-5]^2+R[46]C[-4]^2)" Cells(m + 9, n + -1).FormulaR1C1 = "=R[7]C-R[-11]C" Cells(m + 9, n + 0).FormulaR1C1 = "=R[7]C-R[-11]C" Cells(m + 9, n + 1).FormulaR1C1 = "=R[7]C-R[-11]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 + 11, n + 21).FormulaR1C1 = "the magnetic force of the first current on the second, and" 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 = "dl_2" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 5 Cells(m + 3, n + -1).FormulaR1C1 = "3" Cells(m + 3, n + 0).FormulaR1C1 = "dl_2" 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 + 5, n + 27).FormulaR1C1 = "(Eq-26-2)" Cells(m + 7, n + -1).FormulaR1C1 = "3" Cells(m + 7, n + 0).FormulaR1C1 = "4" Cells(m + 7, n + 1).FormulaR1C1 = "0" Cells(m + 7, n + 2).FormulaR1C1 = "<<-- Position of dL_2." Cells(m + 8, n + -1).FormulaR1C1 = "Alambre 2" 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 = "0" Cells(m + 9, n + 1).FormulaR1C1 = "1" Cells(m + 9, n + 2).FormulaR1C1 = "<<-- Coordinates of vector dL_2." Cells(m + 9, n + 21).FormulaR1C1 = "that of the second on the first; I1 and I2 are the currents, dL1 and dL2 are vectors that represent " 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 = "infinitesimal lengths of wires that carry these currents, r12 is the distance from I1 to I2, r21 is " Cells(m + 11, n + -1).FormulaR1C1 = "3" Cells(m + 11, n + 0).FormulaR1C1 = "0" Cells(m + 11, n + 1).FormulaR1C1 = "3" Cells(m + 11, n + 4).FormulaR1C1 = "=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 = "the distance from I2 to I1, K is a constant that depends on the system units. The product IdL is called " Cells(m + 3, n + 1).Interior.Color = "12611584" 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 4 Cells(m + 3, n + -1).FormulaR1C1 = "4" Cells(m + 3, n + 21).FormulaR1C1 = "the current element and is a vector, while the current is a scalar." Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "The equation described above is a double cross product. The first cross product (right 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 = "right term) is in row 39 for dF12 and 57 for F21, while the final vector multiplication is in row 48 for " Cells(m + 6, n + 21).FormulaR1C1 = "dF12 and 66 for dF21." Cells(m + 7, n + -1).FormulaR1C1 = "=R[-27]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-27]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-27]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "From this equation, the magnetic force of one current on the other can be drawn in three dimensions, " Cells(m + 9, n + -1).FormulaR1C1 = "=R[-27]C[1]*R[-18]C[2]-R[-27]C[2]*R[-18]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-27]C[-1]*R[-18]C[1]+R[-27]C[1]*R[-18]C[-1]" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-27]C[-2]*R[-18]C[-1]-R[-27]C[-1]*R[-18]C[-2]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 = "having the currents (cells G14 and G15), the components of the current elements (A12, B12, C12 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 = "=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 = "A30, B30, C30) and their positions (A10, B10, C10 and A28, B28, C28). Modify these values as " 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 + 11, n + 21).FormulaR1C1 = "desired and observe the behavior of the forces. Try to clarify the paradox of why in some cases " 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 = "dF12" Call AddNewVector End If ' vector ends If m = m1 + 36 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "5" Cells(m + 3, n + 0).FormulaR1C1 = "dF12" Cells(m + 3, n + 21).FormulaR1C1 = "Newton's 3rd law is supposedly not fulfilled (that is, |F12| is different from |F21|) taking into account " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 21).FormulaR1C1 = "that real currents are always closed." 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 + 21).FormulaR1C1 = "Exercises:" Cells(m + 7, n + -1).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-18]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-18]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 = "1. Find the action and reaction forces of two parallel currents of 1 A and 1 m. in length separated by " Cells(m + 9, n + -1).FormulaR1C1 = "=(R[-18]C[1]*R[-9]C[2]-R[-18]C[2]*R[-9]C[1])*R[-30]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=(-R[-18]C[-1]*R[-9]C[1]+R[-18]C[1]*R[-9]C[-1])*R[-30]C" Cells(m + 9, n + 1).FormulaR1C1 = "=(R[-18]C[-2]*R[-9]C[-1]-R[-18]C[-1]*R[-9]C[-2])*R[-30]C[-1]" Cells(m + 9, n + 2).FormulaR1C1 = "=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 22).FormulaR1C1 = "a distance of 1m." 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 = "2. Find the action and reaction forces of two antiparallel currents of 1 A and 1 m. in length separated by " 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 + 11, n + 22).FormulaR1C1 = "a distance of 1m." 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 + 45 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "6" Cells(m + 3, n + 21).FormulaR1C1 = "3. Find these same forces for the same currents but this time perpendicular and lying on " Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 22).FormulaR1C1 = "the XY plane." 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 = "4. Find these same forces for the same currents but this time perpendicular and lying the first " Cells(m + 6, n + 22).FormulaR1C1 = "on the XY plane and the second on the YZ plane." Cells(m + 7, n + -1).FormulaR1C1 = "=R[-27]C" Cells(m + 7, n + 0).FormulaR1C1 = "=R[-27]C" Cells(m + 7, n + 1).FormulaR1C1 = "=R[-27]C" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "=R[-27]C[1]*(-R[-36]C[2])-R[-27]C[2]*(-R[-36]C[1])" Cells(m + 9, n + 0).FormulaR1C1 = "=-R[-27]C[-1]*(-R[-36]C[1])+R[-27]C[1]*(-R[-36]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 = "=R[-27]C[-2]*(-R[-36]C[-1])-R[-27]C[-1]*(-R[-36]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 = "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 = "5296274" 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 = "dF21" Call AddNewVector End If ' vector ends If m = m1 + 54 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "7" Cells(m + 3, n + 0).FormulaR1C1 = "dF21" 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[-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[1]*R[-9]C[2]-R[-54]C[2]*R[-9]C[1])*R[-48]C[1]" Cells(m + 9, n + 0).FormulaR1C1 = "=(-R[-54]C[-1]*R[-9]C[1]+R[-54]C[1]*R[-9]C[-1])*R[-48]C" Cells(m + 9, n + 1).FormulaR1C1 = "=(R[-54]C[-2]*R[-9]C[-1]-R[-54]C[-1]*R[-9]C[-2])*R[-48]C[-1]" 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 = "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 = "" Cells(m1 + 2, n1 - 1).Value = 7 End If ' vector ends If m = m1 + 54 Then Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub