Sub Project_30_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 30_Campo E de part. nucleares_ES ' Updated: 2/05/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 30 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 ="15" Cells(m1 + 0, n1 + 1).FormulaR1C1 ="32" 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 ="X" 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 ="70000" Cells(m1 + 2, n1 + 4).FormulaR1C1 ="Y" 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 ="E" Cells(m1 + 3, n1 + 2).FormulaR1C1 ="=CONFIG!R6C4" Cells(m1 + 3, n1 + 3).FormulaR1C1 ="200" Cells(m1 + 3, n1 + 4).FormulaR1C1 ="Z" Cells(m1 + 3, n1 + 5).FormulaR1C1 ="375" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt as String HELPtxt = "CAMPO DE UN CUADRUPOLO ELƒCTRICO" & Chr(10) & _ " (See english version at the end)" & Chr(10) & _ " Un cuadrupolo elŽctrico se puede definir como el conjunto de cuatro cargas puntuales q distribuidas en el espacio. La forma m‡s sencilla de un cuadrupolo son cuatro cargas distribuidas en los vŽrtices de un cuadrado. Para hallar el campo elŽctrico de un cuadrupolo en cualquier punto del espacio, se aplica el principio de superposici—n, es decir, en cada punto del espacio el campo elŽctrico del dipolo es la suma vectorial de los campos elŽctricos de las cuatro cargas por aparte: " & Chr(10) & _ " E = E1 + E2 + E3 + E4, E1 = k q1 /r1^2, E2 = k q2 /r2^2, E3 = k q3 /r3^2, E4 = k q4 /r4^2 ." & Chr(10) & _ " En las celdas A84, B84 y C84 est‡n las componentes para el campo resultante de las cuatro cargas cargas. En las celdas A10, B10 y C210 se introducen las coordenadas en el espacio en donde se ubica la primera carga y en las celdas A21, B21, C21 est‡n ubicadaa las ecuaciones para calcular el campo elŽctrico de la primera carga: " & Chr(10) & _ " E1x= k q1(x1Žx01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/2)" & Chr(10) & _ " E1y = k q1(y1Žy01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/)2 " & Chr(10) & _ " E1z= k q1(z1Žz01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/2)." & Chr(10) & _ " De manera similar en A28, B28, C28 se introduce la posici[on de la segunda carga y su campo en A39, B39, C39; en A46, B46, C46 la posici—n de la tercera carga y su campo en A57, B57, C57, finalmente en A64, B64, C64 la posici—n de la tercera carga y su campo en A75, B75, C75. " & Chr(10) & _ " Modifique la magnitud de las cargas y su signo en las celdas C6, C24, C42 y C60, as’ como el color de su apariencia. Para calcular el campo elŽctrico en cualquier punto del espacio, introduzca las coordenadas del punto en A83, B83, C83 y oprima cualquier bot—n de coordenadas. " & Chr(10) & _ " La configuraci—n espacial del campo se puede visualizar en diferentes tipos de coordenadas utilizando la celda C79. Para ver el campo en coordenadas esfŽricas coloque C79=s, en cil’ndricas C79=c y en cartesianas C79=o y oprima cualquier bot—n de coordenadas. Modifique a conveniencia los par‡metros del campo en la cadena que aparece en esta misma celda. " & Chr(10) & _ " Para visdualizar el campo elŽctrico resultante con mayor resoluci—n, en la celda C43 modifique entre los primeros parŽntesis cuadrados el valor, poniendo uno m‡s pequeŽo, por ejemplo o[0,5]; entre m‡ pequeŽo sea el valor, mejor ser‡ la resoluci—n pero tardar‡ m‡s tiempo en renderizar. Para ver de nuevo los vectores campo solamente en un punto en particular, borre el contenido del la celda C43 y escriba las coordenadas en donde desee ver el campo en las celdas en A83, B83, C83, por ejemplo A47=0, B47=0, C47=3. " & Chr(10) & _ " (ENGLISH)" & Chr(10) & _ " FIELD OF AN ELECTRICAL QUADRUPOLE" & Chr(10) & _ " An electric quadrupole can be defined as the set of four point charges q distributed in space. The simplest form of a quadrupole is four charges distributed at the vertices of a square. To find the electric field of a quadrupole at any point in space, the superposition principle is applied, that is, at each point in space the electric field of the dipole is the vector sum of the electric fields of the four charges separately:" & Chr(10) & _ " E = E1 + E2 + E3 + E4, E1 = k q1 /r1^2, E2 = k q2 /r2^2, E3 = k q3 /r3^2, E4 = k q4 /r4^2 ." & Chr(10) & _ " In cells A84, B84 and C84 are the components of the field resulting from the four charges. In cells A10, B10 and C210 the coordinates in space where the first charge is located are entered and in cells A21, B21, C21 the equations are located to calculate the electric field of the first charge:" & Chr(10) & _ " E1x= k q1(x1Žx01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/2)" & Chr(10) & _ " E1y = k q1(y1Žy01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/)2" & Chr(10) & _ " E1z= k q1(z1Žz01)/((x1 Ž x01)^2 + (y1 Ž y01)^2 + (z1 Ž z01)^2)^(3/2)." & Chr(10) & _ " Similarly in A28, B28, C28 the position of the second charge and its field are entered in A39, B39, C39; in A46, B46, C46 the position of the third charge and its field in A57, B57, C57, finally in A64, B64, C64 the position of the third charge and its field in A75, B75, C75." & Chr(10) & _ " Change the magnitude of the charges and their sign in cells C6, C24, C42 and C60, as well as the color of their appearance. To calculate the electric field at any point in space, enter the coordinates of the point at A83, B83, C83 and press any coordinate button." & Chr(10) & _ " The spatial configuration of the field can be displayed in different types of coordinates using cell C79. To see the field in spherical coordinates, place C79=s, in cylindrical C79=c and in Cartesian C79=o and press any coordinate button. Modify the field parameters in the string that appears in this very cell. To visualize the resulting electric field with greater resolution, in cell C43 modify the value between the first brackets, putting a smaller one, for example o[0,5]; the smaller the value, the better the resolution, but it will take longer to render. To return to seeing the field vectors only at a particular point, delete the contents of cell C43 and type the coordinates where you want to see the field in cells A83, B83, C83, for example A47=0, B47=0, C47 =3." & Chr(10) & _ " " On Error Resume Next Cells(m1 , n1 + 9).Comment.Text Text:= HELPtxt If m = m1 + 0 Then ' vector 15 Cells(m + 3, n + -1).FormulaR1C1 ="1" Cells(m + 3, n + 0).FormulaR1C1 ="E" Cells(m + 3, n + 2).FormulaR1C1 ="=CONFIG!R6C4" Cells(m + 3, n + 3).FormulaR1C1 ="200" Cells(m + 3, n + 4).FormulaR1C1 ="Z" 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 ="Campo elŽctrico de cargas puntuales" Cells(m + 4, n + 12).FormulaR1C1 ="CAMPO ELƒCTRICO DE PARTêCULAS NUCLEARES" Cells(m + 4, n + 24).FormulaR1C1 ="INSTRUCCIONES" 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 ="=SUMIFS(C[2],C[3],""E_*"")" Cells(m + 6, n + 0).FormulaR1C1 ="=SUMIFS(C[-1],C[2],""E_*"")" Cells(m + 6, n + 1).FormulaR1C1 ="=SUMIFS(C[-1],C[1],""E_*"")" Cells(m + 6, n + 4).FormulaR1C1 ="Constante elŽctrica:" 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 + 7, n + 4).FormulaR1C1 ="k=" Cells(m + 7, n + 5).FormulaR1C1 ="8900000000" Cells(m + 7, n + 21).FormulaR1C1 ="Este modelo es una modificaci—n del modelo Campo ElŽctrico y se adapta para 7 cargas puntuales " Cells(m + 8, n + -1).FormulaR1C1 ="0" Cells(m + 8, n + 0).FormulaR1C1 ="0.0016" Cells(m + 8, n + 1).FormulaR1C1 ="0.0016" Cells(m + 8, n + 2).FormulaR1C1 ="<< --- Punto de estudio del campo" Cells(m + 8, n + 21).FormulaR1C1 ="que se encuentran en los vŽrtices de un cubo, para hallar el campo en el octavo vŽrtice. Las " Cells(m + 9, n + -1).FormulaR1C1 ="=R[-3]C[1]" Cells(m + 9, n + 0).FormulaR1C1 ="=R[-3]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=R[-3]C[-2]" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 ="Magnitud del campo" Cells(m + 9, n + 21).FormulaR1C1 ="magnitudes de las cargas est‡n dadas en unidades de la carga elemental, la constante en unidades " 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 ="resultante:" Cells(m + 10, n + 21).FormulaR1C1 ="del Sistema Internacional (SI) y las distancias del orden de micras. La escala se ha aumentado a 7x10^4." 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 =" |E| =" Cells(m + 11, n + 5).FormulaR1C1 ="=SQRT(R[-2]C[-6]^2+R[-2]C[-5]^2+R[-2]C[-4]^2)" 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 = " + q1" Call AddNewVector end if ' vector ends If m = m1 + 9 Then ' vector 14 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 3, n + 21).FormulaR1C1 ="El campo total se puede calcular por el principio de superposici—n como la suma vectorial de cada" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" Cells(m + 4, n + 4).FormulaR1C1 ="Nœmero de cargas:" Cells(m + 4, n + 21).FormulaR1C1 ="uno de los campos por aparte en el punto en cuesti—n:" 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 =" n =" Cells(m + 5, n + 5).FormulaR1C1 ="=COUNTIF(C[-3],""E_*"")" Cells(m + 6, n + 4).FormulaR1C1 ="(para agregar cargas " Cells(m + 6, n + 27).FormulaR1C1 ="(Eq-25-1)" Cells(m + 7, n + -1).FormulaR1C1 ="0" Cells(m + 7, n + 0).FormulaR1C1 ="0" Cells(m + 7, n + 1).FormulaR1C1 ="0" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 7, n + 4).FormulaR1C1 ="oprima +OBJ.)" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 ="en donde cada uno de los campos se establece por la ley de Coulomb:" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 4).FormulaR1C1 ="Mostrar vectores aux.:" 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 ="SI = 0, NO = 1" Cells(m + 10, n + 5).FormulaR1C1 ="0" Cells(m + 10, n + 27).FormulaR1C1 ="(Eq-25-2)" Cells(m + 11, n + -1).FormulaR1C1 ="1" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[8]C[-4]>0,""<-- use these cells."","""")" 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 + 18 Then ' vector 13 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 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 5, n + 21).FormulaR1C1 ="La constante k depende del sistema de unidades y su valor se introduce en la celda G10." Cells(m + 6, n + 21).FormulaR1C1 ="Estas ecuaciones se ubican respectivamente para cada carga y cada coordenada en las filas 30, 48, 66" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 7, n + 21).FormulaR1C1 ="y 84, y las componentes del campo resultante en las celdas A12, B12 y C12." Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 9, n + 21).FormulaR1C1 ="Modifique los par‡metros de las cargas y sus posiciones en las celdas indicadas a continuaci—n, teniendo " 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 ="en cuenta no excederse en la escala. " Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 = "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 = " + q2" Call AddNewVector end if ' vector ends If m = m1 + 27 Then ' vector 12 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 3, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" Cells(m + 4, n + 21).FormulaR1C1 ="Vec. 1:" Cells(m + 4, n + 22).FormulaR1C1 =" B6 = " Cells(m + 4, n + 23).FormulaR1C1 =" E" Cells(m + 4, n + 24).FormulaR1C1 ="Punto de observaci—n del campo" 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 ="Punto:" Cells(m + 5, n + 22).FormulaR1C1 ="x_o = " Cells(m + 5, n + 23).FormulaR1C1 ="A11" Cells(m + 5, n + 26).FormulaR1C1 ="E_x" Cells(m + 5, n + 27).FormulaR1C1 =" =A12" Cells(m + 6, n + 22).FormulaR1C1 ="y_o = " Cells(m + 6, n + 23).FormulaR1C1 ="B11" Cells(m + 6, n + 24).FormulaR1C1 ="0.0016" Cells(m + 6, n + 26).FormulaR1C1 ="E_y" Cells(m + 6, n + 27).FormulaR1C1 =" =B12" Cells(m + 7, n + -1).FormulaR1C1 ="0" Cells(m + 7, n + 0).FormulaR1C1 ="0" Cells(m + 7, n + 1).FormulaR1C1 ="0.0016" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 7, n + 22).FormulaR1C1 ="z_o = " Cells(m + 7, n + 23).FormulaR1C1 ="C11" Cells(m + 7, n + 24).FormulaR1C1 ="0.0016" Cells(m + 7, n + 26).FormulaR1C1 ="E_z" Cells(m + 7, n + 27).FormulaR1C1 =" =C12" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 21).FormulaR1C1 ="Vec. 2:" Cells(m + 9, n + 22).FormulaR1C1 =" B15 = " Cells(m + 9, n + 23).FormulaR1C1 ="q1" 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 ="Posici—n:" Cells(m + 10, n + 22).FormulaR1C1 ="x_o = " Cells(m + 10, n + 23).FormulaR1C1 =" A19 = " Cells(m + 10, n + 24).FormulaR1C1 ="0" Cells(m + 11, n + -1).FormulaR1C1 ="1" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 22).FormulaR1C1 ="y_o = " Cells(m + 11, n + 23).FormulaR1C1 =" B19 = " Cells(m + 11, n + 24).FormulaR1C1 ="0" 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 + 36 Then ' vector 11 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 22).FormulaR1C1 ="z_o = " Cells(m + 3, n + 23).FormulaR1C1 =" C19 = " Cells(m + 3, n + 24).FormulaR1C1 ="0" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 5, n + 21).FormulaR1C1 ="Vec. 4:" Cells(m + 5, n + 22).FormulaR1C1 =" B33 = " Cells(m + 5, n + 23).FormulaR1C1 ="q2" Cells(m + 6, n + 21).FormulaR1C1 ="Posici—n:" Cells(m + 6, n + 22).FormulaR1C1 ="x_o = " Cells(m + 6, n + 23).FormulaR1C1 =" A37 = " Cells(m + 6, n + 24).FormulaR1C1 ="0" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 7, n + 22).FormulaR1C1 ="y_o = " Cells(m + 7, n + 23).FormulaR1C1 =" B37 = " Cells(m + 7, n + 24).FormulaR1C1 ="0" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 22).FormulaR1C1 ="z_o = " Cells(m + 8, n + 23).FormulaR1C1 =" C37 = " Cells(m + 8, n + 24).FormulaR1C1 ="0.0016" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 9, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" 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 ="Vec. 6:" Cells(m + 10, n + 22).FormulaR1C1 =" B51 = " Cells(m + 10, n + 23).FormulaR1C1 ="q3" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 ="Posici—n:" Cells(m + 11, n + 22).FormulaR1C1 ="x_o = " Cells(m + 11, n + 23).FormulaR1C1 =" A55 = " Cells(m + 11, n + 24).FormulaR1C1 ="0.0016" 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 = " + q3" Call AddNewVector end if ' vector ends If m = m1 + 45 Then ' vector 10 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 3, n + 22).FormulaR1C1 ="y_o = " Cells(m + 3, n + 23).FormulaR1C1 =" B55 = " Cells(m + 3, n + 24).FormulaR1C1 ="0" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" Cells(m + 4, n + 22).FormulaR1C1 ="z_o = " Cells(m + 4, n + 23).FormulaR1C1 =" C55 = " Cells(m + 4, n + 24).FormulaR1C1 ="0.0016" 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 ="______________________________________________________________________________________________" Cells(m + 6, n + 21).FormulaR1C1 ="Vec. 8:" Cells(m + 6, n + 22).FormulaR1C1 =" B69 = " Cells(m + 6, n + 23).FormulaR1C1 ="q4" Cells(m + 7, n + -1).FormulaR1C1 ="0.0016" Cells(m + 7, n + 0).FormulaR1C1 ="0" Cells(m + 7, n + 1).FormulaR1C1 ="0.0016" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 7, n + 21).FormulaR1C1 ="Posici—n:" Cells(m + 7, n + 22).FormulaR1C1 ="x_o = " Cells(m + 7, n + 23).FormulaR1C1 =" A73 = " Cells(m + 7, n + 24).FormulaR1C1 ="0" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 22).FormulaR1C1 ="y_o = " Cells(m + 8, n + 23).FormulaR1C1 =" B73 = " Cells(m + 8, n + 24).FormulaR1C1 ="0.0016" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 22).FormulaR1C1 ="z_o = " Cells(m + 9, n + 23).FormulaR1C1 =" C73 = " Cells(m + 9, n + 24).FormulaR1C1 ="0" 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 ="______________________________________________________________________________________________" Cells(m + 11, n + -1).FormulaR1C1 ="1" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 21).FormulaR1C1 ="Vec. 10:" Cells(m + 11, n + 22).FormulaR1C1 =" B87 = " Cells(m + 11, n + 23).FormulaR1C1 ="q5" 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 + 54 Then ' vector 9 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 21).FormulaR1C1 ="Posici—n:" Cells(m + 3, n + 22).FormulaR1C1 ="x_o = " Cells(m + 3, n + 23).FormulaR1C1 =" A91 = " Cells(m + 3, n + 24).FormulaR1C1 ="0.0016" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 22).FormulaR1C1 ="y_o = " Cells(m + 4, n + 23).FormulaR1C1 =" B91 = " Cells(m + 4, n + 24).FormulaR1C1 ="0.0016" Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 5, n + 22).FormulaR1C1 ="z_o = " Cells(m + 5, n + 23).FormulaR1C1 =" C91 = " Cells(m + 5, n + 24).FormulaR1C1 ="0.0016" Cells(m + 6, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 7, n + 21).FormulaR1C1 ="Vec. 12:" Cells(m + 7, n + 22).FormulaR1C1 =" B105 = " Cells(m + 7, n + 23).FormulaR1C1 ="q6" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 ="Posici—n:" Cells(m + 8, n + 22).FormulaR1C1 ="x_o = " Cells(m + 8, n + 23).FormulaR1C1 =" A109 = " Cells(m + 8, n + 24).FormulaR1C1 ="0.0016" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 9, n + 22).FormulaR1C1 ="y_o = " Cells(m + 9, n + 23).FormulaR1C1 =" B109 = " Cells(m + 9, n + 24).FormulaR1C1 ="0" 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 ="z_o = " Cells(m + 10, n + 23).FormulaR1C1 =" C109 = " Cells(m + 10, n + 24).FormulaR1C1 ="0" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 ="______________________________________________________________________________________________" 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 = " + q4" Call AddNewVector end if ' vector ends If m = m1 + 63 Then ' vector 8 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 3, n + 21).FormulaR1C1 ="Vec. 14:" Cells(m + 3, n + 22).FormulaR1C1 =" B123 = " Cells(m + 3, n + 23).FormulaR1C1 ="q7" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" Cells(m + 4, n + 21).FormulaR1C1 ="Posici—n:" Cells(m + 4, n + 22).FormulaR1C1 ="x_o = " Cells(m + 4, n + 23).FormulaR1C1 =" A127 = " Cells(m + 4, n + 24).FormulaR1C1 ="0.0016" 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 + 22).FormulaR1C1 ="y_o = " Cells(m + 5, n + 23).FormulaR1C1 =" B127 = " Cells(m + 5, n + 24).FormulaR1C1 ="0.0016" Cells(m + 6, n + 22).FormulaR1C1 ="z_o = " Cells(m + 6, n + 23).FormulaR1C1 =" C127 = " Cells(m + 6, n + 24).FormulaR1C1 ="0" Cells(m + 7, n + -1).FormulaR1C1 ="0" Cells(m + 7, n + 0).FormulaR1C1 ="0.0016" Cells(m + 7, n + 1).FormulaR1C1 ="0" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 7, n + 21).FormulaR1C1 ="______________________________________________________________________________________________" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 ="PARçMETROS:" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 9, n + 2).FormulaR1C1 ="=IF(R[-5]C[-1]>1,"" <-- Field formulae"","""")" Cells(m + 9, n + 22).FormulaR1C1 ="Escala:" Cells(m + 9, n + 23).FormulaR1C1 =" E5 = " Cells(m + 9, n + 24).FormulaR1C1 ="70000" 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 ="Paso:" Cells(m + 10, n + 23).FormulaR1C1 =" I3 = " Cells(m + 10, n + 24).FormulaR1C1 ="8" Cells(m + 11, n + -1).FormulaR1C1 ="1" Cells(m + 11, n + 0).FormulaR1C1 ="0" Cells(m + 11, n + 1).FormulaR1C1 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" Cells(m + 11, n + 22).FormulaR1C1 ="N¡ de pasos:" Cells(m + 11, n + 23).FormulaR1C1 =" I4 = " Cells(m + 11, n + 24).FormulaR1C1 ="45" 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 + 72 Then ' vector 7 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 22).FormulaR1C1 ="k=" Cells(m + 3, n + 23).FormulaR1C1 =" G10 = " Cells(m + 3, n + 24).FormulaR1C1 ="8900000000" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="183" Cells(m + 4, n + 22).FormulaR1C1 =" |E| =" Cells(m + 4, n + 23).FormulaR1C1 =" G14 = " Cells(m + 4, n + 24).FormulaR1C1 =" =RAIZ(N10^2+O10^2+P10^2)" Cells(m + 4, n + 27).FormulaR1C1 ="M—dulo del campo." Cells(m + 5, n + -1).FormulaR1C1 ="1" Cells(m + 5, n + 0).FormulaR1C1 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 5, n + 22).FormulaR1C1 =" n =" Cells(m + 5, n + 23).FormulaR1C1 =" G17 = " Cells(m + 5, n + 24).FormulaR1C1 =" =CONTAR.SI(Q:Q;""E_*"")" Cells(m + 5, n + 27).FormulaR1C1 ="Nœmero de cargas" Cells(m + 6, n + 22).FormulaR1C1 ="SI = 0, NO = 1" Cells(m + 6, n + 23).FormulaR1C1 =" G22 = " Cells(m + 6, n + 24).FormulaR1C1 ="0" Cells(m + 6, n + 27).FormulaR1C1 ="Vectores auxiliares." Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 21).FormulaR1C1 ="AGREGAR OBJETOS:" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 9, n + 22).FormulaR1C1 ="Cantidad:" Cells(m + 9, n + 23).FormulaR1C1 =" B2 = " Cells(m + 9, n + 25).FormulaR1C1 ="Utilice esta celda para agregar varias cargas a la vez." 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 ="Fila inicial:" Cells(m + 10, n + 23).FormulaR1C1 =" B3 = " Cells(m + 10, n + 24).FormulaR1C1 ="15" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 ="Fila final:" Cells(m + 11, n + 23).FormulaR1C1 =" C3 = " Cells(m + 11, n + 24).FormulaR1C1 ="32" 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 = " + q5" Call AddNewVector end if ' vector ends If m = m1 + 81 Then ' vector 6 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" 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 ="La magnitud de la carga y su signo se modifican en la celda del color (ejemplo en C15 para la primera carga)." Cells(m + 7, n + -1).FormulaR1C1 ="0.0016" Cells(m + 7, n + 0).FormulaR1C1 ="0.0016" Cells(m + 7, n + 1).FormulaR1C1 ="0.0016" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" 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 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" 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 + 90 Then ' vector 5 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 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 10, n + -1).FormulaR1C1 ="1" Cells(m + 10, n + 0).FormulaR1C1 ="0" Cells(m + 10, n + 1).FormulaR1C1 ="1" Cells(m + 10, n + 4).FormulaR1C1 ="=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 = "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 = " + q6" Call AddNewVector end if ' vector ends If m = m1 + 99 Then ' vector 4 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" 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 ="0.0016" Cells(m + 7, n + 0).FormulaR1C1 ="0" Cells(m + 7, n + 1).FormulaR1C1 ="0" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" 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 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" 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 + 108 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 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 10, n + -1).FormulaR1C1 ="1" Cells(m + 10, n + 0).FormulaR1C1 ="0" Cells(m + 10, n + 1).FormulaR1C1 ="1" Cells(m + 10, n + 4).FormulaR1C1 ="=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 = "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 = " + q7" Call AddNewVector end if ' vector ends If m = m1 + 117 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 ="=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 ="=IF(RC[1]<0, "" - "", "" + "")&""q""&RC[-1]/2" Cells(m + 3, n + 1).FormulaR1C1 ="=3*1.6E-19" Cells(m + 3, n + 2).FormulaR1C1 ="=""<< -- Magnitud y color de q""&RC[-3]/2" Cells(m + 4, n + -1).FormulaR1C1 ="1" Cells(m + 4, n + 0).FormulaR1C1 ="9" 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 ="0.0016" Cells(m + 7, n + 0).FormulaR1C1 ="0.0016" Cells(m + 7, n + 1).FormulaR1C1 ="0" Cells(m + 7, n + 2).FormulaR1C1 ="=""<< -- Posici—n de q""&R[-4]C[-3]/2" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 9, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 9, n + 1).FormulaR1C1 ="=R11C3" 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 ="8" Cells(m + 11, n + 4).FormulaR1C1 ="=IF(R[-1]C[-4]>0,""<-- use these cells."","""")" 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 + 126 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 ="2" Cells(m + 5, n + 1).FormulaR1C1 ="=R22C7" Cells(m + 7, n + -1).FormulaR1C1 ="=R11C1" Cells(m + 7, n + 0).FormulaR1C1 ="=R11C2" Cells(m + 7, n + 1).FormulaR1C1 ="=R11C3" Cells(m + 8, n + -1).FormulaR1C1 ="1" Cells(m + 8, n + 0).FormulaR1C1 ="1" Cells(m + 8, n + 1).FormulaR1C1 ="1" Cells(m + 8, n + 2).FormulaR1C1 ="=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C,2)+POWER(R11C2-R[-11]C[1],2)+POWER(R11C3-R[-11]C[2],2),3/2))*(R11C1-R[-11]C)*R10C7*R[-15]C[2]" Cells(m + 9, n + 0).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-1],2)+POWER(R11C2-R[-11]C,2)+POWER(R11C3-R[-11]C[1],2),3/2))*(R11C2-R[-11]C)*R10C7*R[-15]C[1]" Cells(m + 9, n + 1).FormulaR1C1 ="=1/(POWER(POWER(R11C1-R[-11]C[-2],2)+POWER(R11C2-R[-11]C[-1],2)+POWER(R11C3-R[-11]C,2),3/2))*(R11C3-R[-11]C)*R10C7*R[-15]C" Cells(m + 9, n + 2).FormulaR1C1 ="=""E_""&R[-15]C[-3]/2" Cells(m + 10, n + -1).FormulaR1C1 ="1" Cells(m + 10, n + 0).FormulaR1C1 ="0" Cells(m + 10, n + 1).FormulaR1C1 ="1" Cells(m + 10, n + 4).FormulaR1C1 ="=IF(RC[-4]>0,"" For aditional formula (FA),"","""")" Cells(m + 11, n + -1).FormulaR1C1 ="2" 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 = "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 = "" Cells(m1 + 2, n1 - 1).Value = 15 end if ' vector ends If m = m1 + 126 Then Call BlackWhiteDesk Call PutEqBut end if ' actualizar hoja End Sub