Sub Project_3_ES(ByVal VecType, m, n, m1, n1 As Integer) ' 3_Suma de vectores_ES ' Updated: 25/10/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 3 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 + 0).FormulaR1C1 = "24" 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 + 1).FormulaR1C1 = "A5" 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 + 0).FormulaR1C1 = "t = 0,03125 s." Cells(m1 + 2, n1 + 2).FormulaR1C1 = "=CONFIG!R5C4" Cells(m1 + 2, n1 + 3).FormulaR1C1 = "25" 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 = "A" 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 = "735" Cells(m1, n1 + 9).FormulaR1C1 = "HELP" Dim HELPtxt As String HELPtxt = "SUM OF VECTORS" & Chr(10) & _ " The sum of two arbitrary vectors a = (ax,ay,az), b = (bx,by,bz), distributed in space, can be represented by a resultant vector A = (Ax,Ay,Az), whose coordinates are simply the sum of the corresponding coordinates of each of the vectors:" & Chr(10) & _ " A = (Ax,Ay,Az) = (ax + bx, ay + by, az + bz)" & Chr(10) & _ " Enter the initial coordinates of the first vector in cells A10, B10, C10, the increments of its coordinates in A12, B12, C12. For the second vector correspondingly in A19, B19, C19 and A21, B21, C21. The result is a vector whose coordinates are observed in cells A30, B30, C30 and whose origin can be changed through cells A28, B28, C28." & Chr(10) & _ " Add more vectors and modify the formulas in A30, B30, C30." On Error Resume Next Cells(m1, n1 + 9).Comment.Text Text:=HELPtxt If m = m1 + 0 Then ' vector 3 Cells(m + 3, n + -1).FormulaR1C1 = "1" Cells(m + 3, n + 0).FormulaR1C1 = "A" 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 = "735" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 2).FormulaR1C1 = "Suma de vectores" Cells(m + 4, n + 12).FormulaR1C1 = "SUMA DE VECTORES" 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.3" Cells(m + 6, n + -1).FormulaR1C1 = "=SUMIFS(C[2],C[3],""Vec_*"")" Cells(m + 6, n + 0).FormulaR1C1 = "=SUMIFS(C[-1],C[2],""Vec_*"")" Cells(m + 6, n + 1).FormulaR1C1 = "=SUMIFS(C[-1],C[1],""Vec_*"")" 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 + 8, n + 2).FormulaR1C1 = "=IF(R[5]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 8, n + 4).FormulaR1C1 = "Origin:" Cells(m + 8, n + 21).FormulaR1C1 = "En este modelo se puede sumar o restar cualquier n" & ChrW(250) & "mero de vectores expresados __en tres" 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 + 4).FormulaR1C1 = "A_ox" Cells(m + 9, n + 5).FormulaR1C1 = "2" Cells(m + 9, n + 21).FormulaR1C1 = "dimensiones y mostrar el resultado mediante la regla de cabeza-cola o tambi" & ChrW(233) & "n ubicando todos los" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" Cells(m + 10, n + 4).FormulaR1C1 = "A_ox" Cells(m + 10, n + 5).FormulaR1C1 = "2" Cells(m + 10, n + 21).FormulaR1C1 = "vectores en el origen." 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 = "A_ox" Cells(m + 11, n + 5).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 = "a" Call AddNewVector End If ' vector ends If m = m1 + 9 Then ' vector 2 Cells(m + 3, n + -1).FormulaR1C1 = "2" Cells(m + 3, n + 0).FormulaR1C1 = "=CHAR(95+RC[-1])" Cells(m + 3, n + 21).FormulaR1C1 = "La suma de dos vectores arbitrarios" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 6, n + 4).FormulaR1C1 = "Vector resultante:" Cells(m + 6, n + 27).FormulaR1C1 = "(Eq-3-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 = "A_x =" Cells(m + 7, n + 5).FormulaR1C1 = "=R[-7]C[-6]" Cells(m + 8, n + 4).FormulaR1C1 = "A_y =" Cells(m + 8, n + 5).FormulaR1C1 = "=R[-8]C[-5]" Cells(m + 8, n + 21).FormulaR1C1 = "distribuidos en el espacio, se puede representar mediante un vector resultante, cuyas coordenadas" Cells(m + 9, n + -1).FormulaR1C1 = "0" Cells(m + 9, n + 0).FormulaR1C1 = "2" Cells(m + 9, n + 1).FormulaR1C1 = "6" Cells(m + 9, n + 2).FormulaR1C1 = "=""Vec_""&R[-6]C[-3]-1" Cells(m + 9, n + 4).FormulaR1C1 = "A_z =" Cells(m + 9, n + 5).FormulaR1C1 = "=R[-9]C[-4]" Cells(m + 9, n + 21).FormulaR1C1 = "son simplemente la suma de las coordenadas correspondientes de cada uno de los vectores:" Cells(m + 10, n + -1).FormulaR1C1 = "1" Cells(m + 10, n + 0).FormulaR1C1 = "0" Cells(m + 10, n + 1).FormulaR1C1 = "1" 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 = "|A| =" Cells(m + 11, n + 5).FormulaR1C1 = "=ROUND(SQRT(R[-11]C[-6]^2+R[-11]C[-5]^2+R[-11]C[-4]^2),2)" 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 = "b" Call AddNewVector End If ' vector ends If m = m1 + 18 Then ' vector 1 Cells(m + 3, n + -1).FormulaR1C1 = "=R[-9]C+1" Cells(m + 3, n + 0).FormulaR1C1 = "=CHAR(95+RC[-1])" Cells(m + 3, n + 27).FormulaR1C1 = "(Eq-3-3)" Cells(m + 4, n + -1).FormulaR1C1 = "1" Cells(m + 4, n + 0).FormulaR1C1 = "183" Cells(m + 4, n + 4).FormulaR1C1 = "Presione +OBJ para " Cells(m + 5, n + -1).FormulaR1C1 = "1" Cells(m + 5, n + 0).FormulaR1C1 = "1" Cells(m + 5, n + 1).FormulaR1C1 = "0.3" Cells(m + 5, n + 4).FormulaR1C1 = "agregar m" & ChrW(225) & "s vectores" Cells(m + 6, n + 4).FormulaR1C1 = "Presione -OBJ para " Cells(m + 6, n + 21).FormulaR1C1 = "Insertar en A30, B30, C30 las coordenadas del segundo vector." 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 + 4).FormulaR1C1 = "eliminar vectores" Cells(m + 7, n + 21).FormulaR1C1 = "Insertar en A21, B21, C21 las coordenadas del primer vector" Cells(m + 8, n + 2).FormulaR1C1 = "=IF(R[-4]C[-1]>1,"" <-- Variable coordinates"","""")" Cells(m + 9, n + -1).FormulaR1C1 = "4" Cells(m + 9, n + 0).FormulaR1C1 = "3" Cells(m + 9, n + 1).FormulaR1C1 = "1" Cells(m + 9, n + 2).FormulaR1C1 = "=""Vec_""&R[-6]C[-3]-1" Cells(m + 9, n + 4).FormulaR1C1 = "Modificar las coordenadas" Cells(m + 9, n + 21).FormulaR1C1 = "Agregar m" & ChrW(225) & "s vectores presionando +OBJ." 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 = "del vector a la izquierda" Cells(m + 10, n + 21).FormulaR1C1 = "Eliminar vector con -OBJ." 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 = "de Vec_*" 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 = "" Cells(m1 + 2, n1 - 1).Value = 3 End If ' vector ends If m = m1 + 18 Then Call BlackWhiteDesk Call PutEqBut End If ' actualizar hoja End Sub