Sub Project_34_EN(ByVal VecType, m, n, m1, n1 As Integer) ' 34_Magnetic field of a loop dL_EN ' Updated: 11/10/24 ' Created by: A. Becerra (10/10/24) ' Modified by: _________________ ' This is the code of your new project. ' Steps to embed the code to ScienSolar: ' Note 1: The number 34 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 (into the VBA editor) to automate the download of the project. ' Note 3: The formulas and cell values generated here correspond only to the first 30 columns in the sheet. All your formulas and values are recommended to be written in these columns. ' Step 1. Go to the CONFIG sheet (at the end of column C) and add the number of your new project to the last row in the projects list, and a short name in the corresponding langage column. ' 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 ="800" Cells(m1 + 0, n1 + 6).FormulaR1C1 ="=CONFIG!R3C8" Cells(m1 + 0, n1 + 7).FormulaR1C1 ="8" Cells(m1 + 0, n1 + 8).FormulaR1C1 ="A. Becerra (10/10/24)" Cells(m1 + 1, n1 + 2).FormulaR1C1 ="=CONFIG!R4C4" Cells(m1 + 1, n1 + 3).FormulaR1C1 ="450" 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 + 0).FormulaR1C1 ="t = 0,4609375 s." Cells(m1 + 2, n1 + 2).FormulaR1C1 ="=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 ="6000" 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 ="45" Cells(m1 + 3, n1 + 0).FormulaR1C1 ="dB" 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 = "HELP Comment:" & Chr(10) & _ " 1. To create new projects, press the +Vector button without selecting any project in the project list." & Chr(10) & _ " 2. To load an existing project, select a project from the list and then press +Vector" & Chr(10) & _ " 3. To export a new project, press the Get Code button. The code will be saved on your PC in the same directory where this file is located." & Chr(10) & _ " " & Chr(10) & _ " If necessary, use this comment to create your own HELP comment for your project. To do this, simply replace this text with your own (Right Click, Edit Comment) and avoid special characters." & Chr(10) & _ " After pressing Get Code, your comment will be updated and saved in the same txt file as your project and will be uploaded after the project appears in ScienSolar.To include the new project in ScienSolar, perform the following steps:" & Chr(10) & _ " a) Open the txt file where the project was saved; b) copy all the contents of the file and paste it in the VBA Editor of the Excel file ScienSolar; c) add the project name and number to the list on the CONFIG sheet; d) Verify that the number is correlative and that it agrees with the project header number, if not modify it in the header or in the list as necessary." & Chr(10) & _ " Right click to delete or edit this comment." & Chr(10) & _ " " & Chr(10) & _ " For documentation on ScienSolar, please visit www.sciensolar.com. ScienSolar was designed for 3D physics modeling in MS Excel.It is normal that for some projects it takes time to load it in the sheet, it depends on the number of objects in your project and the performance of your PC." On Error Resume Next Cells(m1 , n1 + 9).Comment.Text Text:= HELPtxt If m = m1 + 0 Then ' vector 8 Cells(m + 3, n + -1).FormulaR1C1 ="1" Cells(m + 3, n + 0).FormulaR1C1 ="dB" 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 + 1).FormulaR1C1 ="=IF(R[27]C[4]=0,"""",VLOOKUP(R[27]C[4],R[29]C[1]:R[43]C[4],3))" Cells(m + 4, n + 2).FormulaR1C1 ="Magnetic field of a current loop element" Cells(m + 4, n + 12).FormulaR1C1 ="MAGNETIC FIELD OF AN ELEMENT OF A CIRCULAR CURRENT" Cells(m + 4, n + 24).FormulaR1C1 ="INSTRUCTIONS" Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="=IF(R[26]C[5]=0,1,""60*1"")" Cells(m + 5, n + 1).FormulaR1C1 ="0" Cells(m + 7, n + -1).FormulaR1C1 ="=R[1]C" Cells(m + 7, n + 0).FormulaR1C1 ="=R[1]C" Cells(m + 7, n + 1).FormulaR1C1 ="=R[1]C" Cells(m + 8, n + -1).FormulaR1C1 ="0" Cells(m + 8, n + 0).FormulaR1C1 ="0.04" Cells(m + 8, n + 1).FormulaR1C1 ="0.034" Cells(m + 8, n + 2).FormulaR1C1 ="<-- (x, y, z) " Cells(m + 9, n + -1).FormulaR1C1 ="=(R[54]C[1]*R[63]C[2]-R[54]C[2]*R[63]C[1])*R[8]C[1]" Cells(m + 9, n + 0).FormulaR1C1 ="=(-R[54]C[-1]*R[63]C[1]+R[54]C[1]*R[63]C[-1])*R[8]C" Cells(m + 9, n + 1).FormulaR1C1 ="=(R[54]C[-2]*R[63]C[-1]-R[54]C[-1]*R[63]C[-2])*R[8]C[-1]" Cells(m + 9, n + 2).FormulaR1C1 ="<-- (Bx, By, Bz)" Cells(m + 9, n + 4).FormulaR1C1 =" |dB| =" Cells(m + 9, n + 5).FormulaR1C1 ="=SQRT(RC[-6]^2+RC[-5]^2+RC[-4]^2)" Cells(m + 9, n + 21).FormulaR1C1 ="MAGNETIC FIELD OF A CURRENT" 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 ="The objective of this model is to understand the Biot-Savart law and calculate the magnetic field dB " 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 ="of a current element dL that is part of a circular current of radius Ro." Cells(m + 3, n + 1).Interior.Color = "255" Cells(m + 3, n + 1).Font.Size = "12" 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 7 Cells(m + 3, n + -1).FormulaR1C1 ="2" Cells(m + 3, n + 0).FormulaR1C1 ="a" Cells(m + 3, n + 21).FormulaR1C1 ="The magnetic field dB of an infinitesimal current element IdL at any point in space at a distance r " Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 4).FormulaR1C1 ="PARAMETERS:" Cells(m + 4, n + 21).FormulaR1C1 ="from the current element is calculated by the Biot-Savart formula:" 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 =" I=" Cells(m + 5, n + 5).FormulaR1C1 ="10000" Cells(m + 6, n + 4).FormulaR1C1 =" Ro = " Cells(m + 6, n + 5).FormulaR1C1 ="0.02" Cells(m + 6, n + 27).FormulaR1C1 ="(Eq-28-1)" Cells(m + 7, n + -1).FormulaR1C1 ="=R[3]C[6]" Cells(m + 7, n + 0).FormulaR1C1 ="=R[4]C[5]" Cells(m + 7, n + 1).FormulaR1C1 ="=R[5]C[4]" Cells(m + 7, n + 2).FormulaR1C1 ="<-- O" Cells(m + 7, n + 4).FormulaR1C1 =" K=" Cells(m + 7, n + 5).FormulaR1C1 ="0.0000001" Cells(m + 8, n + -1).FormulaR1C1 ="K=" Cells(m + 8, n + 0).FormulaR1C1 ="=R[-3]C[5]*R[-1]C[5]/POWER(R[55]C[-1]^2+R[55]C^2+R[55]C[1]^2,3/2)" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 ="POSITION" Cells(m + 9, n + -1).FormulaR1C1 ="=R[5]C[6]*COS(RADIANS(R[6]C[6]))*SIN(RADIANS(R[7]C[6]))" Cells(m + 9, n + 0).FormulaR1C1 ="=R[5]C[5]*SIN(RADIANS(R[6]C[5]))*SIN(RADIANS(R[7]C[5]))" Cells(m + 9, n + 1).FormulaR1C1 ="=R[5]C[4]*COS(RADIANS(R[7]C[4]))" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 ="Origin O:" Cells(m + 9, n + 21).FormulaR1C1 ="where K is a constant depending on the system of units. The resulting field of several current " 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 =" x =" Cells(m + 10, n + 5).FormulaR1C1 ="0" Cells(m + 10, n + 21).FormulaR1C1 ="elements is the vector sum of each of the fields, i.e. for n current elements the resulting field is" 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 =" y =" Cells(m + 11, n + 5).FormulaR1C1 ="0" Cells(m + 3, n + 1).Interior.Color = "5855577" Cells(m + 3, n + 1).Font.Size = "12" 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 6 Call Project_15(15, m, n, m1, n1) Cells(m + 3, n + -1).FormulaR1C1 ="3" Cells(m + 3, n + 4).FormulaR1C1 =" z =" Cells(m + 3, n + 5).FormulaR1C1 ="0" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="186" Cells(m + 4, n + 2).FormulaR1C1 ="DRAW THE LOOP:" Cells(m + 4, n + 4).FormulaR1C1 ="Inclination:" Cells(m + 4, n + 27).FormulaR1C1 ="(Eq-28-2)" 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 ="|" Cells(m + 5, n + 4).FormulaR1C1 =" r=" Cells(m + 5, n + 5).FormulaR1C1 ="0.02" Cells(m + 6, n + -1).FormulaR1C1 ="Choose the vector to make its graphic:" Cells(m + 6, n + 2).FormulaR1C1 ="3 (Run >>)" Cells(m + 6, n + 4).FormulaR1C1 =" phi=" Cells(m + 6, n + 5).FormulaR1C1 ="0" Cells(m + 7, n + 2).FormulaR1C1 ="<< -- 2 (Vector Nr. 6)" Cells(m + 7, n + 4).FormulaR1C1 =" theta" Cells(m + 7, n + 5).FormulaR1C1 ="0" Cells(m + 7, n + 21).FormulaR1C1 ="When the number of elements tends to infinity and the length of each of them tends to zero, this " Cells(m + 8, n + -1).FormulaR1C1 ="Max. steps:" Cells(m + 8, n + 0).FormulaR1C1 ="50" Cells(m + 8, n + 2).FormulaR1C1 ="|" Cells(m + 8, n + 21).FormulaR1C1 ="sum becomes an integral. In the present model, however, finite magnitudes and quantities are used." Cells(m + 9, n + 2).FormulaR1C1 ="<< -- 1 (Press)" Cells(m + 10, n + -1).FormulaR1C1 ="1" Cells(m + 10, n + 0).FormulaR1C1 ="0" Cells(m + 10, n + 1).FormulaR1C1 ="2" Cells(m + 10, n + 2).FormulaR1C1 ="|" Cells(m + 10, n + 4).FormulaR1C1 ="=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 10, n + 21).FormulaR1C1 ="Enter the coordinates of the field observation point in A11, B11 and C11." 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 + 11, n + 21).FormulaR1C1 ="With the -> button, navigate through different IdL stream elements." Cells(m + 3, n + 1).Interior.Color = "12611584" Cells(m + 3, n + 1).Font.Size = "12" 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 5 Cells(m + 3, n + -1).FormulaR1C1 ="4" Cells(m + 3, n + 2).FormulaR1C1 ="FIELD VIEWS:" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 3).FormulaR1C1 ="Insert 0,1,2,3É->>" Cells(m + 4, n + 5).FormulaR1C1 ="0" 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 + 2).FormulaR1C1 ="Value" Cells(m + 5, n + 3).FormulaR1C1 ="Description" Cells(m + 5, n + 4).FormulaR1C1 ="Formula and color" Cells(m + 5, n + 22).FormulaR1C1 ="G17" Cells(m + 5, n + 23).FormulaR1C1 ="Current value" Cells(m + 6, n + 2).FormulaR1C1 ="0" Cells(m + 6, n + 6).FormulaR1C1 =" " Cells(m + 6, n + 22).FormulaR1C1 ="G18" Cells(m + 6, n + 23).FormulaR1C1 ="Coil radius" 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 + 2).FormulaR1C1 ="1" Cells(m + 7, n + 3).FormulaR1C1 ="Cart." Cells(m + 7, n + 4).FormulaR1C1 ="=""o[0,001665]x=[0;0]o2[0,008]y=[-0,04;0,04]o3[0,008]z=[-0,03;0,04]color=[""&RC[1]&""]origin[cart.]=[0;0;0]tfactor=0,003778176s""" Cells(m + 7, n + 5).FormulaR1C1 ="0.3" Cells(m + 7, n + 6).FormulaR1C1 =" " Cells(m + 7, n + 22).FormulaR1C1 ="G19" Cells(m + 7, n + 23).FormulaR1C1 ="K constant" Cells(m + 8, n + 2).FormulaR1C1 ="2" Cells(m + 8, n + 3).FormulaR1C1 ="Esf." Cells(m + 8, n + 4).FormulaR1C1 ="=""s[0,007]r=[0;0,025]s2[180]phi=[""&R[26]C[-1]&"";""&R[26]C[-1]+360&""]s3[30]theta=[0;180]color=[""&RC[1]&""]origin[cart.]=[""&R[26]C[-5]&"";""&R[26]C[-4]&"";""&R[26]C[-3]&""]tfactor=0,003895721s""" Cells(m + 8, n + 5).FormulaR1C1 ="0.5" Cells(m + 8, n + 6).FormulaR1C1 =" " 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 ="3" Cells(m + 9, n + 3).FormulaR1C1 ="Esf." Cells(m + 9, n + 4).FormulaR1C1 ="=""s[0,00167]r=[0,025;0,025]s2[10]phi=[0;360]s3[10]theta=[90;180]color=[""&RC[1]&""]origin[cart.]=[0;0;0,01]tfactor=0,003895721s""" Cells(m + 9, n + 5).FormulaR1C1 ="0.07" Cells(m + 9, n + 21).FormulaR1C1 ="The results of the dB components calculated by the formula (Eq-28-1) are shown in A12, B12 and C12." 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 ="4" Cells(m + 10, n + 3).FormulaR1C1 ="Cart." Cells(m + 10, n + 4).FormulaR1C1 ="=""o[0,002]x=[-0,04;0,04]o2[0,002]y=[-0,02;0,04]o3[0,008]z=[0;0]color=[""&RC[1]&""]origin[cart.]=[""&R[6]C[-5]&"";""&R[6]C[-4]&"";""&R[6]C[-3]&""]tfactor=0,003778176s""" Cells(m + 10, n + 5).FormulaR1C1 ="0.1" Cells(m + 10, n + 21).FormulaR1C1 ="The dB magnitude for the given element is calculated in G12." 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 + 2).FormulaR1C1 ="5" Cells(m + 11, n + 3).FormulaR1C1 ="Cart." Cells(m + 11, n + 4).FormulaR1C1 ="=""o[0,001665]x=[0;0]o2[0,008]y=[-0,02;0,04]o3[0,008]z=[-0,03;0,04]color=[""&RC[1]&""]origin[cart.]=[""&R[23]C[-5]&"";""&R[23]C[-4]&"";""&R[23]C[-3]&""]tfactor=0,003778176s""" Cells(m + 11, n + 5).FormulaR1C1 ="1" Cells(m + 11, n + 7).FormulaR1C1 =" " Cells(m + 3, n + 1).Interior.Color = "65280" Cells(m + 3, n + 1).Font.Size = "12" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "Ro" Call AddNewVector end if ' vector ends If m = m1 + 36 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 ="5" Cells(m + 3, n + 0).FormulaR1C1 ="Ro" Cells(m + 3, n + 2).FormulaR1C1 ="6" Cells(m + 3, n + 3).FormulaR1C1 ="Cil." Cells(m + 3, n + 4).FormulaR1C1 ="=""c[0,006]rho=[0,01;0,03]c2[10]phi=[0;360]c3[0,00666]z=[0,01;0,01]color=[""&RC[1]&""]origin[cart.]=[0;0;0]tfactor=0,003801384s""" Cells(m + 3, n + 5).FormulaR1C1 ="0.9" Cells(m + 3, n + 21).FormulaR1C1 ="To draw the complete loop: Press the ResetGraph button (located in B30), select the radius vector " Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 2).FormulaR1C1 ="7" Cells(m + 4, n + 3).FormulaR1C1 ="Cil." Cells(m + 4, n + 4).FormulaR1C1 ="=""c[0,006]rho=[0,02;0,02]c2[10]phi=[0;360]c3[0,00666]z=[0,01;0,01]color=[""&RC[1]&""]origin[cart.]=[""&R[-21]C[1]&"";""&R[-20]C[1]&"";""&R[-19]C[1]&""]tfactor=0,003801384s""" Cells(m + 4, n + 5).FormulaR1C1 ="0.1" Cells(m + 4, n + 21).FormulaR1C1 ="(in the list located in C28) and press the Run >> button (located in K5) twice." Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="4" Cells(m + 5, n + 1).FormulaR1C1 ="0.3" Cells(m + 6, n + 21).FormulaR1C1 ="To view the dB vector of the current dL at different points in space, use cell G34 with values __from 0 to 7." 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 + 8, n + -1).FormulaR1C1 ="Radio de la espira:" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R[-30]C[6]*COS(RADIANS(R[-21]C[6]))*COS(RADIANS(R[-20]C[6]))" Cells(m + 9, n + 0).FormulaR1C1 ="=R[-30]C[5]*SIN(RADIANS(R[-21]C[5]))*COS(RADIANS(R[-20]C[5]))" Cells(m + 9, n + 1).FormulaR1C1 ="=-R[-30]C[4]*SIN(RADIANS(R[-20]C[4]))" 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(R[18]C[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 ="4" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="1" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[17]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "12611584" Cells(m + 3, n + 1).Font.Size = "12" 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 3 Cells(m + 3, n + -1).FormulaR1C1 ="6" 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.9" Cells(m + 6, n + -1).FormulaR1C1 ="=SIN(RADIANS(R[-49]C[8]))" Cells(m + 6, n + 0).FormulaR1C1 ="=1-COS(RADIANS(R[-49]C[7]))" 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 + -1).FormulaR1C1 ="Radio rotativo (oculto)" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R[-9]C+R[-3]C[1]*(R[-18]C[1]*R[-18]C*R[-9]C[1]-R[-18]C[1]*R[-18]C[1]*R[-9]C+R[-18]C[2]*R[-18]C*R[-9]C[2]-R[-18]C[2]*R[-18]C[2]*R[-9]C)+R[-3]C*(R[-18]C[1]*R[-9]C[2]-R[-18]C[2]*R[-9]C[1])" Cells(m + 9, n + 0).FormulaR1C1 ="=R[-9]C+R[-3]C*(-R[-18]C[-1]*R[-18]C[-1]*R[-9]C+R[-18]C[-1]*R[-18]C*R[-9]C[-1]+R[-18]C[1]*R[-18]C*R[-9]C[1]-R[-18]C[1]*R[-18]C[1]*R[-9]C)+R[-3]C[-1]*(-R[-18]C[-1]*R[-9]C[1]+R[-18]C[1]*R[-9]C[-1])" Cells(m + 9, n + 1).FormulaR1C1 ="=R[-9]C+R[-3]C[-1]*(-R[-18]C[-2]*R[-18]C[-2]*R[-9]C+R[-18]C[-2]*R[-18]C*R[-9]C[-2]-R[-18]C[-1]*R[-18]C[-1]*R[-9]C+R[-18]C[-1]*R[-18]C*R[-9]C[-1])+R[-3]C[-2]*(R[-18]C[-2]*R[-9]C[-1]-R[-18]C[-1]*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(R[18]C[-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 ="2" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[17]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "5287936" Cells(m + 3, n + 1).Font.Size = "12" Cells(m + 3, n + 1).Font.name = "Calibri" Cells(m + 4, n - 1).Value = 1 Cells(m1 + 1, n1 + 1).Value = "dl" Call AddNewVector end if ' vector ends If m = m1 + 54 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 ="7" Cells(m + 3, n + 0).FormulaR1C1 ="dl" 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 + 2).FormulaR1C1 ="r" Cells(m + 6, n + 3).FormulaR1C1 ="phi" Cells(m + 7, n + -1).FormulaR1C1 ="=R[-7]C+R[-9]C" Cells(m + 7, n + 0).FormulaR1C1 ="=R[-7]C+R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 ="=R[-7]C+R[-9]C" Cells(m + 7, n + 2).FormulaR1C1 ="=SQRT(RC[-3]^2+RC[-2]^2+RC[-1]^2)" Cells(m + 7, n + 3).FormulaR1C1 ="=DEGREES(ATAN2(RC[-4],RC[-3]))" Cells(m + 8, n + -1).FormulaR1C1 ="Vector elemento de corriente" 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[-9]C[2]-R[-27]C[2]*R[-9]C[1]" Cells(m + 9, n + 0).FormulaR1C1 ="=-R[-27]C[-1]*R[-9]C[1]+R[-27]C[1]*R[-9]C[-1]" Cells(m + 9, n + 1).FormulaR1C1 ="=R[-27]C[-2]*R[-9]C[-1]-R[-27]C[-1]*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(R[-54]C[-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.5" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-55]C[-4]>0,""<-- use these cells."","""")" Cells(m + 3, n + 1).Interior.Color = "49407" Cells(m + 3, n + 1).Font.Size = "12" 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 + 63 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 ="8" Cells(m + 3, n + 0).FormulaR1C1 ="r" 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" Cells(m + 7, n + 0).FormulaR1C1 ="=R[-9]C" Cells(m + 7, n + 1).FormulaR1C1 ="=R[-9]C" Cells(m + 8, n + -1).FormulaR1C1 ="Radio del campo B" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R[-64]C-R[-54]C-R[-18]C" Cells(m + 9, n + 0).FormulaR1C1 ="=R[-64]C-R[-54]C-R[-18]C" Cells(m + 9, n + 1).FormulaR1C1 ="=R[-64]C-R[-54]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 = "11826222" Cells(m + 3, n + 1).Font.Size = "12" 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 = 8 end if ' vector ends If m = m1 + 63 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