'//////////////////////////////////// ((((((())))))) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ' ScienSolar v. 1.62 MAIN MODULE 2. Updated 11-02-2026 ' PhD Ariel R. Becerra B. ' Main changes in the new version: ' A new Field Scanner button has been added to facilitate and improve the functionality of cells C7, C16, etc. for vector and scalar field projects. ' To update, you only need to replace MAIN MODULE 1 and MAIN MODULE 2 in your Excel workbook with ScienSolar installed. ' For technical documentation, updates, or assistance, visit www.sciensolar.com. '//////////////////////////////////// ((((((())))))) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ' ScienSolar package for modeling physics and mathematics in MS Excel (tested on MS Excel 2013-2019 for Windows and Mac). ' The package is distributed in 8 text files and must be integrated into an Excel file. ' By downloading the package you agree to the terms and conditions under the license GNU General Public License v.3.0 (https://www.gnu.org/licenses/gpl-3.0.html). ' You may use the ScienSolar package for free only under the terms of this license. '//////////////////////////////////// ((((((())))))) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Sub NewSheet() 'Macro to add new sheet with the necessary configuration for ScienSolar 'Create the CONFIG sheet with all default parameters and text 'Segment NewSheet 01. Check if the CONFIG configuration sheet exists, if not, add it. Application.ScreenUpdating = False Dim i As Integer Dim j As Integer Dim k As Integer Dim sheet As Object Dim nombre As Variant Dim Txt As String nombre = "CONFIG" For Each sheet In ThisWorkbook.Sheets If nombre = sheet.name Then GoTo salida End If Next sheet Sheets.Add ActiveSheet.name = "CONFIG" 'Segment NewSheet 02. Prepare the help system in multiple languages. 'Column AA: cell selected by the user; Column AB: help text for this cell; columns AE through AK: text in multiple languages Range("AA1").Value = "HELP MENU" Range("AA2").Value = "Pressing the ? button displays the help text for the active cell." Range("AA3").Value = "Al presionar el botn ? se muestra el texto de ayuda para la celda activa." Range("AA4").Value = "ADDRESS" Range("AA5").Value = "ZONE1" Range("AA6").Value = "ZONE2" Range("AA7").Value = "ZONE3" Range("AA8").Value = "ZONE4" Range("AA9").Value = "ZONE5" Range("AB1").FormulaR1C1 = "=IF(R[1]C[-11]=1,RC[3],IF(R[1]C[-11]=2,RC[4],IF(R[1]C[-11]=3,RC[5],IF(R[1]C[-11]=4,RC[6],IF(R[1]C[-11]=5,RC[7],IF(R[1]C[-11]=6,RC[8],RC[9]))))))" Range("AE1").Value = "HELP on a CELL: select it and press the question button. HELP on a BUTTON: select the cell under the button. To hide press the button located at F3. For quick help on a particular project, place the cursor over the HELP cell." Range("AF1").Value = "AYUDA sobre una CELDA: seleccinela y oprima el botn de interrogacin. AYUDA sobre un BOTN: seleccione la celda bajo el botn.Para ocultar presione el botn ubicado en F3. Para ayuda rpida sobre un proyecto en particular coloque el cursor sobre la celda HELP." Range("AC2").Value = "Celda libre, no est ligada a ninguna funcin especial de ScienSolar. " 'Segment NewSheet 02a. Set the language codes Range("AE4").Value = 1 Range("AF4").Value = 2 Range("AG4").Value = 3 Range("AH4").Value = 4 Range("AI4").Value = 5 Range("AJ4").Value = 6 Range("AK4").Value = 7 Range("AE3").FormulaR1C1 = "= R6C1" Range("AF3").FormulaR1C1 = "= R7C1" Range("AG3").FormulaR1C1 = "= R8C1" Range("AH3").FormulaR1C1 = "= R9C1" Range("AI3").FormulaR1C1 = "= R10C1" Range("AJ3").FormulaR1C1 = "= R11C1" Range("AK3").FormulaR1C1 = "= R12C1" Range("AC3").FormulaR1C1 = "= R13C1" 'NewSheet Segment 02b. Set the default recurring formulas (Spanish, English) for the vector cells (columns A, B, C) up to row 104. Txt = Range("AC2").Value For i = 1 To 104 Cells(i + 9, 27).Value = "A" & i Cells(i + 113, 27).Value = "B" & i Cells(i + 217, 27).Value = "C" & i Next i k = 24 For i = 1 To 10 For j = 1 To 9 'Spanish Cells(k, 32).FormulaR1C1 = "=R" & j + 14 & "C32" Cells(k + 104, 32).FormulaR1C1 = "=R" & j + 118 & "C32" Cells(k + 208, 32).FormulaR1C1 = "=R" & j + 222 & "C32" 'English Cells(k, 31).FormulaR1C1 = "=R" & j + 14 & "C31" Cells(k + 104, 31).FormulaR1C1 = "=R" & j + 118 & "C31" Cells(k + 208, 31).FormulaR1C1 = "=R" & j + 222 & "C31" k = k + 1 'For other languages copy and paste the English rows and replace 31 by 33 and so on Next j Next i 'NewSheet Segment 02c. Set the default text for free cells For i = 1 To 41 'Address of the free cell Cells(i + 321, 27).Value = "D" & i Cells(i + 362, 27).Value = "E" & i Cells(i + 403, 27).Value = "F" & i Cells(i + 444, 27).Value = "G" & i 'Spanish. "Celda libre." Cells(i + 321, 32).Value = "CELDA D" & i & ". " & Txt Cells(i + 362, 32).Value = "CELDA E" & i & ". " & Txt Cells(i + 403, 32).Value = "CELDA F" & i & ". " & Txt Cells(i + 444, 32).Value = "CELDA G" & i & ". " & Txt 'English. "Free cell." Cells(i + 321, 31).Value = "Free cell." Cells(i + 362, 31).Value = "Free cell." Cells(i + 403, 31).Value = "Free cell." Cells(i + 444, 31).Value = "Free cell." 'For other languages copy and paste the English rows and replace 31 by 33 and so on Next i 'NewSheet Segment 02d. Preliminary set 'free cells' for the cells in columns H to U of the dashboard k = 1 For j = 1 To 14 For i = 1 To 5 Cells(k + 485, 27).Value = Left(Cells(i, j + 7).Address(0, 0), 1) & i Cells(k + 485, 32).Value = "CELDA " & Left(Cells(i, j + 7).Address(0, 0), 1) & i & ". " & Txt Cells(k + 485, 31).Value = "Cell " & Left(Cells(i, j + 7).Address(0, 0), 1) & i & ". " & "Free cell." k = k + 1 Next i Next j 'NewSheet Segment 02e. Formula to select the help text in the selected language For i = 5 To 555 Cells(i, 28).FormulaR1C1 = "=HLOOKUP(R2C17,R4C30:R800C37,RC[2])" Next i For i = 2 To 555 Cells(i + 3, 30).Value = i Next i 'ESPANOL. valores predeterminados para la columna A Range("AF5").Value = "COLUMNAS D y E estn disponibles para uso libre y alli se pueden introducir frmulas de Excel para los modelos." Range("AF6").Value = "COLUMNAS F y G estn disponibles para uso libre y pueden ser usadas para que el usuario ingrese parmetros iniciales. La columna G tiene un formato condicional que cuando se ingresan datos su color de fondo cambia." Range("AF7").Value = "ZONA 3: COLUMNAS DESDE H HASTA U y desde la fila 5 hacia abajo. Esta zona est dedicada al sistema de coordenadas . Todos los objetos que se configuren en las columnas A, B y C aparecern en el sistema de coordenadas en esta zona. En esta zona tambin se pueden ubicar ecuaciones editadas en el editor de ecuaciones y guardadas en la hoja 3DModels, para ello escriba el nmero de la ecuacin entre parntesis en el formato (Eq-3-1), en donde la expresin (Eq- al principio es obligatoria, seguida de cualquier valor numrico o letras. Para visualizar la ecuacin, se debe oprimir el correspondiente botn. Los botones para las ecuaciones para un proyecto nuevo aparecern luego de exportar el cdigo e introducirlo a ScienSolar. " Range("AF8").Value = "ZONA 4. COLUMNAS DESDE V HASTA AC. Esta zona est libre y puede dedicarse a escribir all la teora sobre el modelo o instrucciones de su ejecucin. En ella se puede escribir directamente texto en las celdas de la zona en blanco, La informacin ingresada en estas columnas se guardar en el cdigo de cada proyecto." Range("AF9").Value = "ZONA 5: Esta zona comprende las columnas posteriores a la columna AD, y estn disponibles para que el usuario haga clculos y coloque frmulas temporales. Sin embargo el cdigo del proyecto no exportar los datos ni frmulas ingresados en esta zona, luego de oprimir el botn cdigo. " Range("AF10").Value = "Celda libre. " Range("AF11").Value = "Esta celda es usada por ScienSolar para inicializar el programa, por favor no elimine ni modifique el contenido de esta celda. " Range("AF12").Value = "Celda libre. " Range("AF13").Value = "Botn para exportar el cdigo del proyecto en curso. Este botn est destinado a exportar los proyectos nuevos o modificados en forma de cdigo VBA en un archivo de texto que se guarda en la misma carpeta en la que se encuentra el archivo ScienSolar. Lea las instrucciones en el encabezado del archivo exportado para saber cmo se integra el proyecto a la lista de proyectos. Al oprimir el botn, le pedir el nombre del archivo de texto que se guardar. Mientras no se copie el cdigo de un proyecto al editor de VBA este no aparecer ni se modificar en ScienSolar. La celda tambin la utiliza el programa y contiene el nmero del proyecto que se selecciona en la lista de proyectos." _ & "Observacin: Hay que tener en cuenta que al exportar el cdigo, algunos caracteres especiales (como tildes o smbolos) pueden no trabajar correctamente en algunos sistemas operativos. Se recomienda al exportar no incluir caracteres especiales en el nombre del archivo." Range("AF14").Value = "Esta celda est ocupada y es usada para indicar el nmero de vectores u objetos que se encuentran en el sistema de coordenadas. Este nmero es utilizado por el cdigo para desplegar/recoger el men de configuraciones." Range("AF15").Value = "Cuando se carga un vector o un objeto al sistema de coordenadas, esta celda indica el nmero del vector consecutivo. " _ & "BOTN DE LA IZQUIERDA: " _ & "se utiliza para activar/desactivar el grosor del vector y su historia. " _ & "BOTN DE LA DERECHA: se utiliza para comprimir o desplegar las celdas de configuracin de cada vector. " _ & "El botn del primer vector desplegar o comprimir la configuracin de todos los vectores." _ & "BOTN DE LA DERECHA cuando hay DATOS: se utiliza para borrar la tabla de datos. " _ & "PROPIEDADES: El valor 0 en esta celda no pone el vector en el sistema de coordenadas, aunque s tiene en cuenta los " _ & "parmetros y frmulas que se encuentran en su configuracin, lo cual tiene utilidad en algunos casos," _ & "por ejemplo cuando no se quiere visualizar el vector o cuando la cantidad de vectores es grande y se desea reducir el tiempo" _ & "de ejecucin. Los nmeros en estas celdas deben ser consecutivos ascendentes y no se deben repetir." Range("AF16").Value = "Celda utilizada por ScienSolar para indicar si la configuracin del vector est desplegada o plegada. El valor 0 indica plegada y el valor 1 desplegada. No modifique el valor de esta celda. " Range("AF17").Value = "El valor indicado aqu representa el nmero de objetos (vectores) clonados para el vector dado. Cuando la opcin de este vector es MODO CAMPO el nmero es mayor que 1, de lo contrario es igual a 1. PROPIEDADES: Cuando se est trabajando en modo campo y la cantidad de objetos cargados a la hoja es muy grande, para borrarlos inmediatamente se coloca en esta celda un nmero mayor a 5000 y se oprime un botn de actualizacin. De otra manera no modifique esta celda." Range("AF18").Value = "Celda libre cuando se usa el vector (183). PROPIEDADES: Cuando se carga un objeto 3D (200) esta celda se usa para introducir el ngulo de rotacin del objeto. Como ejemplo ver el vector nmero 2 del proyecto Modelo 3D (oprimir Ejecutar en ese proyecto)." Range("AF19").Value = "Esta celda indica la posicin inicial en el eje X del vector actual. Cuando se trabaja en modo CAMPO, el cdigo automticamente borra los datos de esta celda y los reemplaza por =A11, puesto que en A11 se recorrern (en modo campo) todos los valores iniciales de las coordenadas en X de los vectores del campo. dados para un rango en la coordenada X. En esta celda el usuario puede introducir valores constantes as como funciones." _ & "Para ver como funciona, en una nueva hoja de ScienSolar agregue un nuevo vector y en A12 = 4, B12= 3, C12 = 0. Oprima XYZ, Ponga otros valores y observe los cambios en el sistema de coordenadas. " Range("AF20").Value = "Esta celda es usada por el cdigo cuando se trabaja en MODO CAMPO para recorrer todos los valores de las coordenadas como variables. Dicho de otra manera, esta celda equivale a la variable X cuando se trabaja con una funcin f(x). Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF21").Value = "En esta celda se introduce el valor de la coordenada en el eje X del vector. Cuando se trabaja en MODO CAMPO, se introduce aqu la funcin correspondiente al eje X del campo vectorial. Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF22").Value = "Cola del vector. Cuando se utiliza un vector convencional (183), se puede cambiar la forma de la cola del vector. Algunas otras formas diferentes a la 183 tambin pueden obedecer a esta celda. Los valores permitidos son del 1 al 6. Tambin pueden introducirse funciones que cambien este valor automticamente." Range("AF23").Value = "Cabeza del vector. Cuando se utiliza un vector convencional (183), se puede cambiar la forma de la cabeza del vector. Algunas otras formas diferentes a la 183 tambin pueden obedecer a esta celda. Los valores permitidos son del 1 al 6. Tambin pueden introducirse funciones que cambien este valor automticamente." 'ENGLISH: Range("AE5").Value = "COLUMNS D and E are available for free use and Excel formulas for the models can be entered there." Range("AE6").Value = "COLUMNS F and G are available for free use and can be used for the user to enter initial parameters. Column G has conditional formatting that when data is entered, its background color changes." Range("AE7").Value = "ZONE 3: COLUMNS FROM H TO U and row 5 down. This zone is dedicated to the coordinate system. All objects that are configured in columns A, B and C will appear in the coordinate system.system in this area, in this area you can also locate equations edited in the equation editor and saved in the 3DModels sheet, to do this write the equation number in parentheses in the format (Eq-3-1) , where the expression (Eq- at the beginning is required, followed by any numerical value or letter. To view the equation, you need to press the corresponding button. The buttons for the equations for a new project will appear after exporting the code and entering it into ScienSolar." Range("AE8").Value = "ZONE 4. COLUMNS FROM V TO AC. This area is free and can be dedicated to writing the theory about the model or instructions for its execution. In it you can write text directly in the cells. of the blank area, The information entered in these columns will be saved in the code of each project." Range("AE9").Value = "ZONE 5: This zone includes the columns after column AD and are available for the user to perform calculations and place temporary formulas. However, the project code will not export the data or formulas entered in this area, after pressing the code button." Range("AE10").Value = "Free cell." Range("AE11").Value = "ScienSolar uses this cell to initialize the program; do not delete or modify the contents of this cell." Range("AE12").Value = "Free cell." Range("AE13").Value = "Get Code Button. This button is intended to export new or modified projects in the form of VBA code in a text file that is saved in the same folder in which the ScienSolar file is located. Read the instructions in the header of the exported file to find out how the project is integrated into the project list. When you press the button, it will ask you for the name of the text file that will be saved. As long as the code of a project is not copied in the VBA editor, this will not appear or be modified in ScienSolar. The cell is also used by the program and contains the number of the project that is selected in the project list." _ & "Note: Keep in mind that when exporting the code, some special characters (such as accent marks or symbols) may not work correctly in some operating systems. It is recommended when exporting not to include special characters in the file name." Range("AE14").Value = "This cell is occupied and is used to indicate the number of vectors or objects that are in the coordinate system. This number is used by the code to display/collect the settings menu." Range("AE15").Value = "When a vector or object is loaded into the coordinate system, this cell indicates the number of the consecutive vector." _ & "BUTTON ON THE LEFT: " _ & "is used to enable/disable the vector thickness and its history." _ & "BUTTON ON THE RIGHT is used to compress or expand the configuration cells of each vector." _ & "The first vector button will display or compress the settings for all vectors." _ & "BUTTON ON THE RIGHT WHEN THERE IS DATA is used to clean the data table." _ & "PROPERTIES: The value 0 in this cell does not put the vector in the coordinate system, although it does take into account the " _ & "parameters and formulas found in its configuration, which is useful in some cases," _ & "for example when you do not want to display the vector or when the number of vectors is large and you want to reduce the execution time." _ & " The numbers in these cells must be consecutively ascending and must not be repeated." Range("AE16").Value = "This cell is used by ScienSolar to indicate whether the vector configuration is unfolded or folded. A value of 0 indicates folded and a value of 1 displays. Do not modify the value of this cell." Range("AE17").Value = "The value indicated here represents the number of objects (vectors) cloned for the given vector. When the option of this vector is FIELD MODE the number is greater than 1, otherwise it is equal to 1. PROPERTIES: When you are working in field mode and the number of objects loaded on the sheet is very large, to delete them immediately, place a number greater than 5000 in this cell and press an update button. Otherwise, do not modify this cell." Range("AE18").Value = "This cell is free when the vector (183) is used. PROPERTIES: When a 3D object is loaded (200) this cell is used to enter the rotation angle of the object. As an example see vector number 2 of the 3D Model project (press Run on that project)." Range("AE19").Value = "This cell indicates the initial position on the X axis of the current vector. When working in FIELD mode, the code automatically deletes the data in this cell and replaces it with =A11, since in A11 all the initial values of the X coordinates of the field vectors given for a range in the X coordinate will be traversed (in field mode). In this cell the user can enter constant values as well as functions." _ & "To see how it works, in a new ScienSolar sheet add a new vector and put in A12 = 4, B12 = 3, C12 = 0. Press XYZ, Put in other values and observe the changes in the coordinate system. " Range("AE20").Value = "This cell is used by the code when working in FIELD MODE to cycle through all the coordinate values as variables. In other words, this cell is equivalent to the variable X when working with a function f(x). As an example of using this cell, see the ELECTRIC DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields, see the FUNCTIONS project." Range("AE21").Value = "In this cell the value of the coordinate on the X axis of the vector is entered. When working in FIELD MODE, the function corresponding to the X axis of the vector field is entered here. As an example of use of this cell see the ELECTRICAL DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields see the FUNCTIONS project." Range("AE22").Value = "Vector tail. When using a conventional vector (183), the shape of the vector tail can be changed. Some shapes other than 183 can also obey this cell. The Allowed values are 1 to 6. Functions can also be introduced that change this value automatically." Range("AE23").Value = "Vector head. When using a conventional vector (183), the shape of the vector head can be changed. Some shapes other than 183 can also obey this cell. The Allowed values are 1 to 6. Formulas can also be entered that change this value automatically." 'ESPANOL valores predeterminados de ayuda para la columna B: Range("AF114").Value = "Celda libre." ' B1 Range("AF115").Value = "Esta celda tiene como objetivo indicar la cantidad de objetos que desea agregar o eliminar presionando una vez el botn respectivo. Indique un nmero entero o deje en blanco." 'B2 Range("AF116").Value = "En un proyecto en particular se pueden configurar paquetes de celdas que representen objetos ms complejos que un simple vector. Utilice estos botones para agregar o quitar estos objetos del modelo. Especifique en esta celda el nmero de fila en el que empezar el objeto. Para ver cmo funciona este botn y esta celda, acuda al proyecto PIRMIDE 3D. " 'B3 Range("AF117").Value = "Celda libre." 'B4 Range("AF118").Value = "Celda libre." 'B5 Range("AF119").Value = "ETIQUETA DEL VECTOR. Ingrese aqu la etiqueta del vector que aparecer en el sistema de coordenadas al lado del vector. PROPIEDADES: Si no se introduce ningn valor, el vector aparecer sin etiqueta en el sistema de coordenadas. Tambin se pueden introducir funciones de etiquetas variables, ver ejemplo en el proyecto CUADRUPOLO para etiquetas de las cargas q1, q2, q3, q4." Range("AF120").Value = "TIPO DE FORMA a representar en el sistema de coordenadas. La forma tpica para ScienSolar es la de cdigo 183. " _ & "Esta forma est elaborada en ScienSolar para que represente perfectamente a un vector. Sin embargo se pueden utilizar " _ & "otras formas para otros fines, pero cabe resaltar que para otros cdigos diferentes a 183 las rotaciones no funcionan correctamente. PROPIEDADES: se aceptan valores desde 1 hasta 183, " _ & "los valores negativos congelan sus dimensiones y no obedecen a la rotacin. Valor 183 para vectores. Valor 146 para un punto en el espacio. " _ & "Valor 200 para cargar un objeto 3D de la hoja 3DModels, con ello indicando en la etiqueta del vector el nombre del objeto (ver como ejemplo el vector 2 del proyecto MODELO 3D). " _ & "Para visualizar fcilmente todas las formas haga lo siguiente: oprima RESET (RESTABLECER), luego +VECTOR e introduzca los siguientes valores: B7 =I5, I3=1, I4=200, E5=60 y oprima " _ & "el botn --> para navegar por los diferentes valores de I5, es decir de B7. El valor B=-114 permite cargar un cuadro de texto con indicador " _ & "de una celda, por ejemplo B=-114 (negativo), B9=15 y C9=4 ubicar el indicador en la celda que est en la fila 15 y la columna 4." Range("AF121").Value = "TIPO DE LNEA DEL VECTOR" & Chr(13) _ & "Para lnea continua se introduce 1 y para diferentes tipos de lnea punteada del 2 al 12." _ & Chr(13) & Chr(13) & "CONTROL DEL TAMAO DEL VECTOR EN EL SISTEMA DE COORDENADAS" _ & Chr(13) & "Si el valor de esta celda es de la forma 60*4, en donde en lugar de 60 se introduce cualquier nmero mayor que 15, se indica con esto el porcentaje del vector con respecto al tamao de los ejes, y en lugar de 4 cualquier nmero que indica el grado de agudeza con que la funcin del campo cambia. Utilice esta configuracin especialmente en modo campo para controlar que el tamao de los vectores no sobrepase el tamao del sistema de coordenadas, y la funcin campo adquiera suavidad. Controle esta suavidad con el segundo nmero. Para que esta funcin se active es necesario el formato 60*4 (el asterisco es obligatorio, y sin el signo igual)." _ & " Nota: esta funcin puede cambiar la apariencia real de los vectores. " Range("AF122").Value = "Celda libre para la forma 183. Para la forma 200 se introduce aqu el otro ngulo de rotacin del objeto 3D (ver proyecto MODELO 3D, vector2). Para la forma -114 se introduce aqu la fila de posicin del indicador." Range("AF123").Value = "Esta celda indica la posicin inicial en el eje Y del vector actual. Cuando se trabaja en modo CAMPO, el cdigo automticamente borra los datos de esta celda y los reemplaza por =B11, puesto que en B11 se recorrern (en modo campo) todos los valores iniciales de las coordenadas en Y de los vectores del campo dados para un rango en la coordenada Y. En esta celda el usuario puede introducir valores constantes as como funciones." _ & "Para ver como funciona, en una nueva hoja de ScienSolar agregue un nuevo vector y en A12 = 4, B12= 3, C12 = 0. Oprima XYZ, Ponga otros valores y observe los cambios en el sistema de coordenadas. " Range("AF124").Value = "Esta celda es usada por el cdigo cuando se trabaja en MODO CAMPO para recorrer todos los valores de las coordenadas como variables. Dicho de otra manera, esta celda equivale a la variable y cuando se trabaja con una funcin f(y). Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF125").Value = "En esta celda se introduce el valor de la coordenada en el eje Y del vector. Cuando se trabaja en MODO CAMPO, se introduce aqu la funcin correspondiente al eje Y del campo vectorial. Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF126").Value = "NMERO DE FILA para el inicio de una tabla de salida de datos durante la ejecucin de un modelo. El nmero de columnas que tendr la tabla es 9 con" _ & " las coordenadas iniciales, finales y dos celdas ms para frmulas adicionales. El nmero de filas depende de la resolucin de toma de datos del problema en particular. " _ & "Para ver cmo funciona esta celda oprima New Sheet (Nueva hoja) seleccione el proyecto MOVIMIENTO PARABLICO de la lista y oprima +VECTOR, " _ & "luego, para el vector velocidad coloque B40=30, B41=10, D41=a y E41=b; oprima Ejecutar (Run). Aparecer, a partir de la celda indicada, una tabla con los datos de la simulacin. La tabla se" _ & "puede borrar simplemente OPRIMIENO EL BOTN EN LA COLUMNA A DE ESTE VECTOR. En lugar de las letras a y b se pueden introducir otras funciones. " _ & "El valor 0 para esta celda deshabilita esta funcin. Solo se aceptan valores numricos positivos. Los datos pueden ser usados para otros estudios en Excel u otros programas de anlisis de datos. " Range("AF127").Value = "NMERO DE COLUMNA para el inicio de una tabla de salida de datos durante la ejecucin de un modelo. El nmero de columnas que tendr la tabla es 9 con" _ & " las coordenadas iniciales, finales y dos celdas ms para frmulas adicionales. El nmero de filas depende de la resolucin de toma de datos del problema en particular. " _ & "Para ver cmo funciona esta celda oprima New Sheet (Nueva hoja) seleccione el proyecto MOVIMIENTO PARABLICO de la lista y oprima +VECTOR, " _ & "luego, para el vector velocidad coloque B40=25, B41=7, D41=a y E41=b; oprima Ejecutar (Run). Aparecer, a partir de la celda indicada, una tabla con los datos de la simulacin. La tabla se" _ & "puede borrar simplemente OPRIMIENO EL BOTN EN LA COLUMNA A DE ESTE VECTOR. En lugar de las letras a y b se pueden introducir otras funciones. " _ & "El valor 0 para esta celda deshabilita esta funcin. Solo se aceptan valores numricos positivos. Los datos pueden ser usados para otros estudios en Excel u otros programas de anlisis de datos. " 'ENGLISH Range("AE114").Value = "Free cell." 'B1 Range("AE115").Value = "This cell is intended to indicate the number of objects you want to add or delete by pressing the respective button once. Enter an integer or leave blank." 'B2 Range("AE116").Value = "In a particular project, packages of cells can be configured that represent more complex objects than a simple vector. Use these buttons to add or remove these objects from the model. Specify in this cell the row number at which the object will start. To see how this button and this cell work, go to the 3D PYRAMID project." 'B3 Range("AE117").Value = "Free cell." 'B4 Range("AE118").Value = "Free cell." 'B5 Range("AE119").Value = "VECTOR LABEL. Enter here the vector label that will appear in the coordinate system next to the vector. PROPERTIES: If no value is entered, the vector will appear without a label in the system. You can also introduce variable label functions, see example in the QUADRUPOLE project for labels of the electric charges q1, q2, q3, q4." Range("AE120").Value = "TYPE OF SHAPE to be represented in the coordinate system. The shape that is pre-established for ScienSolar is code 183." _ & "This shape is created in ScienSolar so that it perfectly represents a vector. However, you can use " _ & "other forms for other purposes, but it should be noted that for codes other than 183 the rotations do not work correctly. PROPERTIES: values from 1 to 183 are accepted, " _ & "negative values freeze their dimensions and do not obey rotation. Value 183 for vectors. Value 146 for a point in space. " _ & "Value 200 to load a 3D object from the 3DModels sheet, thereby indicating the name of the object in the vector label (see as an example vector 2 of the 3D MODEL project). " _ & "To easily view all shapes do the following: press RESET, then +VECTOR and enter the following values: B7 =I5, I3=1, I4=200, E5=60 and press " _ & "the button --> to navigate through the different values of I5, that is, B7. The value B=-114 allows loading a text box with indicator " _ & "of a cell, for example B=-114 (negative), B9=15 and C9=4 will place the text box indicator in the cell that is in row 15 and column 4." Range("AE121").Value = "VECTOR LINE TYPE" & Chr(13) _ & "For a solid line, enter 1 and for different types of dotted lines, enter 2 to 12." _ & Chr(13) & Chr(13) & "CONTROL OF THE VECTOR SIZE IN THE COORDINATE SYSTEM" _ & Chr(13) & "Change the size of the vectors by entering in the value of this cell an expression of the form 60*4, where instead of 60 any number greater than 15 is entered, thus indicating the percentage of the vector with respect to the size of the axes, and instead of 4 any number that indicates how sharply the field function changes. Use this setting especially in field mode to control that the size of the vectors does not exceed the size of the system coordinates, and the function of the field is controlled with the second number. For this function to be activated, the format 60*4 is required (the asterisk is mandatory, and without the equal sign)." _ & " Remark: This function can change the actual appearance of the vectors. " Range("AE122").Value = "Free cell for shape 183. For shape 200, the other rotation angle of the 3D object is entered here (see 3D MODEL project, vector2). For shape -114, the indicator position row." Range("AE123").Value = "This cell indicates the initial position on the Y axis of the current vector. When working in FIELD mode, the code automatically deletes the data in this cell and replaces it with =B11, since in B11 all the initial values of the Y coordinates of the given field vectors will be traversed (in field mode) for a range in the Y coordinate. In this cell the user can enter constant values as well as functions." _ & "To see how it works, in a new ScienSolar sheet add a new vector and put in A12 = 4, B12 = 3, C12 = 0. Press XYZ, Put in other values and observe the changes in the coordinate system. " Range("AE124").Value = "This cell is used by the code when working in FIELD MODE to cycle through all coordinate values as variables. In other words, this cell is equivalent to the Y variable when working with a function f(y). As an example of using this cell, see the ELECTRIC DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields, see the FUNCTIONS project." Range("AE125").Value = "In this cell the value of the coordinate on the Y axis of the vector is entered. When working in FIELD MODE, the function corresponding to the Y axis of the vector field is entered here. As an example of use of this cell see the ELECTRICAL DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields see the FUNCTIONS project." Range("AE126").Value = "ROW NUMBER for the start of a data output table during the execution of a model. The number of columns the table will have is 9 with" _ & " the initial and final coordinates and two more cells for additional formulas. The number of rows depends on the data collection resolution of the particular problem. " _ & "To see how this cell works press New Sheet, select the PARABOLIC MOTION project from the list and press +VECTOR, " _ & "then, for the velocity vector, place B40=30, B41=10, D41=a and E41=b; press Run. A table with the simulation data will appear from the indicated cell. The table " _ & "can be deleted simply by pressing the BUTTON IN COLUMN A of this vector. " _ & "The value 0 for this cell disables this function. Only positive numerical values are accepted. The data can be used for other studies in Excel or other data analysis programs." Range("AE127").Value = "COLUMN NUMBER for the start of a data output table during the execution of a model. The number of columns the table will have is 9 with" _ & " the initial and final coordinates and two more cells for additional formulas. The number of rows depends on the data collection resolution of the particular problem. " _ & "To see how this cell works press New Sheet, select the PARABOLIC MOTION project from the list and press +VECTOR, " _ & "then, for the velocity vector, place B40=25, B41=10, D41=a and E41=b; press Run. A table with the simulation data will appear from the indicated cell. The table HE" _ & "can be deleted simply by by pressing the BUTTON IN COLUMN A of this vector. " _ & "The value 0 for this cell disables this function. Only positive numerical values are accepted. The data can be used for other studies in Excel or other data analysis programs." 'valores predeterminados de ayuda para la columna C: Range("AF218").Value = "Celda libre." ' C1 Range("AF219").Value = "Celda libre." 'C2 Range("AF220").Value = "En un proyecto en particular se pueden configurar paquetes de celdas que representen objetos ms complejos que un simple vector. Utilice estos botones para agregar o quitar estos objetos del modelo. Especifique en esta celda el nmero de fila en el que empezar el objeto. Para ver cmo funciona este botn y esta celda, acuda al proyecto PIRMIDE 3D. " 'C3 Range("AF221").Value = "Etiqueta predeterminada del vector nuevo que se va a descargar. Esta celda no requiere ninguna accin. Para ver como funciona, en una nueva hoja escriba en esta celda la letra E y oprima +Vector." 'C4 Range("AF222").Value = "Celda libre." 'C5 Range("AF223").Value = "Color del vector o de la forma que se carga al sistema de coordenadas. Cambie el color de fondo de esta celda con la respectiva herramienta de Excel" _ & " y cambiar el color del vector (luego de oprimir XYZ). Esta celda est libre para utilizarla con datos o frmulas. Para ver cmo funciona, " _ & "en una nueva hoja de ScienSolar oprima +Vector, luego cambie el color de esta celda y oprima XYZ. Cambie el cdigo de la forma a 114 (en lugar de 183), oprima YZ, cambie el color y vuelva a oprimir YZ." Range("AF224").Value = "MODO CAMPO. Posibles valores:" _ & Chr(13) & "o --> coordenadas cartesianas," _ & Chr(13) & "c --> coordenadas cilndricas," _ & Chr(13) & "s --> coordenadas esfricas," _ & Chr(13) & "vaca --> modo campo deshabilitado." _ & Chr(13) & Chr(13) & "Una vez ingresado uno de estos valores (en minscula y sin el signo igual), oprimiendo XYZ aparecer una cadena de valores que se explica a continuacin. Se deben modificar nicamente los valores entre corchetes de acuerdo a las unidades de las coordenadas:" _ & Chr(13) & Chr(13) & "COORDENADAS CARTESIANAS:" _ & Chr(13) & "o[5]x=[40;40] --> paso y rango en x," _ & Chr(13) & "o2[20]y=[-100;100] --> paso y rango en y," _ & Chr(13) & "o3[40]z=[0;100] --> paso y rango en z," _ & Chr(13) & Chr(13) & "COORDENADAS CILNDRICAS:" _ & Chr(13) & "c[5]rho=[40;40] --> paso y rango en rho," _ & Chr(13) & "c2[20]phi=[0;360] --> paso y rango en phi," _ & Chr(13) & "c3[40]z=[0;100] --> paso y rango en z," _ & Chr(13) & Chr(13) & "COORDENADAS ESFRICAS:" _ & Chr(13) & "s[5]r=[40;40] --> paso y rango en r," _ & Chr(13) & "s2[20]phi=[180;270] --> paso y rango en phi," _ & Chr(13) & "s3[5]theta=[0;90] --> paso y rango en theta," _ & Chr(13) & Chr(13) & "color=[80] --> magnitud aproximada del mayor vector para distribuir el gradiente de color en todos los vectores de acuerdo a su magnitud," _ & Chr(13) & "[cart.]=[0;0;0] --> corrimiento del origen de coordenadas con respecto al original," _ & Chr(13) & "tfactor=0,001386089s --> informacin del tiempo de puesta de un solo vector en la hoja. No requiere ninguna accin." _ & Chr(13) & Chr(13) & "PROPIEDADES: Esta celda slo puede ser usada para clonar los vectores en el espacio tridimensional. Cuando est vaca, su funcin se inactiva. La distribucin de los vectores se puede hacer de tres maneras" _ & ": a travs de coordenadas cartesianas, cilndricas o esfricas. Ejemplos de aplicacin de esta funcin se pueden ver en en el vector 5 del proyecto DIPOLO ELCTRICO y una forma ms avanzada de su uso en los proyectos" _ & " DIPOLO ELCTRICO, SIMETRA PLANA, SIMETRA CILNDRICA y SIMETRA ESFRICA." Range("AF225").Value = "Transparencia del vector en curso. Se aceptan valores positivos decimales desde 0 hasta 1, en donde con el valor 0 no tiene transparencia y con el valor 1 su transparencia es total. Esta funcin es til por ejemplo para vectores auxiliares que no hacen parte del problema directamente. " Range("AF226").Value = "Celda libre para la forma 183. Para la forma -114 se introduce aqu la columna de posicin del indicador (la fila se introduce en la celda contigua de la izquierda.) " _ & Chr(13) & Chr(13) & "Para ver cmo funciona, abra una nueva hoja de ScienSolar, oprima +Vector para agregar un nuevo vector y coloque (con signo menos) B7=-114, B9=6,C9=3 con el propsito de apuntar a la celda del color. " _ & "Oprima YZ para ver el resultado. Cambie los valores B9=8,C9=5 para apuntar a la celda que se encuentra en la fila 8, columna 5. Coloque B10=3 C10=3 para cambiar la posicin del cuadrado. " _ & "Coloque B12=8, C12=3 para cambiar su tamao. Oprima YZ para ver el resultado. Oprima >>C para rotar el sistema de coordenadas. Quite el signo menos en B7, B7=114. Oprima de nuevo >>C para ver la diferencia." Range("AF227").Value = "Esta celda indica la posicin inicial en el eje Z del vector actual. Cuando se trabaja en modo CAMPO, el cdigo automticamente borra los datos de esta celda y los reemplaza por =C11, puesto que en C11 se recorrern (en modo campo) todos los valores iniciales de las coordenadas en Z de los vectores del campo dados para un rango en la coordenada Z. En esta celda el usuario puede introducir valores constantes as como funciones." _ & Chr(13) & Chr(13) & " Para ver como funciona, en una nueva hoja de ScienSolar agregue un nuevo vector y en A12 = 4, B12= 3, C12 = 0. Oprima XYZ. Ponga otros valores y observe los cambios en el sistema de coordenadas. " Range("AF228").Value = "Esta celda es usada por el cdigo cuando se trabaja en MODO CAMPO para recorrer todos los valores de las coordenadas como variables. Dicho de otra manera, esta celda equivale a la variable z cuando se trabaja con una funcin f(z). Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF229").Value = "En esta celda se introduce el valor de la coordenada en el eje Z del vector. Cuando se trabaja en MODO CAMPO, se introduce aqu la funcin correspondiente al eje Z del campo vectorial. Como ejemplo de uso de esta celda ver los proyectos DIPOLO ELCTRICO, SIMETRA CILNDRICA y SIMETRA ESFRICA. Para campos escalares ver el proyecto FUNCIONES." Range("AF230").Value = "Celda de HISTORIA del vector. Posibles valores 1 y 2. " _ & "Con el valor 2 el vector dejar huella de su recorrido en la hoja de clculo, lo cual es visible cuando el vector cambia de posicin. Cuando se coloca el valor 1 despus de haber tenido el valor 2, los vectores antiguos irn desapareciendo de forma paulatina cuando se ejecuta alguna accin. " _ & Chr(13) & Chr(13) & "Para ver como trabaja, en una hoja nueva de ScienSolar agregue un vector (oprimiendo el botn +Vector) e ingrese el nmero 2 en la celda C13=2. Oprima el botn de rotacin >>C. Ahora cambie las posiciones iniciales del vector y sus coordenadas y vuelva a oprimir >>C. " _ & "Observar que aparece en el sistema de coordenadas un abanico de vectores. Posteriormente ingrese C13=1 y oprima >>C para ver desaparecer los vectores paulatinamente. Oprima de nuevo >>C para su total desaparicin. " _ & "Si desea que los vectores desaparezcan instantneamente, debe colocar en la celda A8 un valor mayor a 5000, por ejemplo A8=6000 y oprimir cualquier botn de actualizacin. " Range("AF231").Value = "Grosor del vector. El valor predeterminado es 1. Para vectores ms gruesos coloque un valor mayor que 1. Aqu, como en otras celdas de configuracin, se pueden ingresar frmulas dinmicas que cambian la apariencia de los vectores dependiendo de ciertos parmetros particulares para cada proyecto. " 'ENGLISH Range("AE218").Value = "Free cell." ' C1 Range("AE219").Value = "Free cell." 'C2 Range("AE220").Value = "In a particular project, packages of cells can be configured that represent more complex objects than a simple vector. Use these buttons to add or remove these objects from the model. Specify in this cell the row number at which the object will end. To see how this button and this cell work, go to the 3D PYRAMID project." Range("AE221").Value = "Default label of the new vector to be downloaded. This cell requires no action. To see how this works, in a new sheet, type the letter E in this cell and press +Vector." 'C4 Range("AE222").Value = "Free cell." 'C5 Range("AE223").Value = "Color of the vector or shape that is loaded into the coordinate system. Change the background color of this cell with the respective Excel tool" _ & " and will change the color of the vector (after pressing XYZ). This cell is free to use with data or formulas. To see how it works, " _ & "in a new ScienSolar sheet press +Vector, then change the color of this cell and press XYZ. Change the shape code to 114 (instead of 183), press YZ, change the color and press YZ again. " Range("AE224").Value = "FIELD MODE. Possible values:" _ & Chr(13) & "o --> Cartesian Coordinates," _ & Chr(13) & "c --> Cylindrical Coordinates," _ & Chr(13) & "s --> Spherical Coordinates," _ & Chr(13) & "empty --> Field Mode disabled." _ & Chr(13) & Chr(13) & "Once one of these values has been entered (in lower case and without the equal sign), pressing XYZ will display a string of values explained below. Only the values in brackets should be modified according to the units of the coordinates:" _ & Chr(13) & Chr(13) & "CARTESIAN COORDINATES:" _ & Chr(13) & "o[5]x=[40;40] --> Step and range in x," _ & Chr(13) & "o2[20]y=[-100;100] --> Step and range in y," _ & Chr(13) & "o3[40]z=[0;100] --> Step and range in z," _ & Chr(13) & Chr(13) & "CYLINDRICAL COORDINATES:" _ & Chr(13) & "c[5]rho=[40;40] --> Step and range in rho," _ & Chr(13) & "c2[20]phi=[0;360] --> Step and range in phi," _ & Chr(13) & "c3[40]z=[0;100] --> Step and range in z," _ & Chr(13) & Chr(13) & "SPHERICAL COORDINATES:" _ & Chr(13) & "s[5]r=[40;40] --> Step and range in r," _ & Chr(13) & "s2[20]phi=[180;270] --> Step and range in phi," _ & Chr(13) & "s3[5]theta=[0;90] --> Step and range in theta," _ & Chr(13) & Chr(13) & "color=[80] --> Approximate magnitude of the largest vector to distribute the color gradient in all vectors according to their magnitude," _ & Chr(13) & "[cart.]=[0;0;0] --> Shift of the origin of coordinates with respect to the original," _ & Chr(13) & "tfactor=0.001386089s --> Information on the time of placing a single vector on the sheet. No action required." _ & Chr(13) & Chr(13) & "PROPERTIES: This cell can only be used to clone the vectors in three-dimensional space. When it is empty, its function is inactive. The distribution of the vectors can be done in three ways" _ & ": through Cartesian, cylindrical or spherical coordinates. Examples of application of this function can be seen in vector 5 of the ELECTRIC DIPOLE project and a more advanced form of its use in projects" _ & "ELECTRIC DIPOLE, PLANE SYMMETRY, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY." Range("AE225").Value = "Transparency of the current vector. Positive decimal values are accepted from 0 to 1, where with the value 0 it has no transparency and with the value 1 its transparency is total. This function is useful for example for auxiliary vectors that are not directly part of the problem." Range("AE226").Value = "Free cell for form 183. For form -114, the indicator position column is entered here (the row is entered in the adjacent cell on the left.) " _ & Chr(13) & Chr(13) & "To see how it works, open a new ScienSolar sheet, press +Vector to add a new vector and place (with minus sign) B7=-114, B9=6,C9= 3 for the purpose of targeting the color cell." _ & "Press YZ to see the result. Change the values B9=8,C9=5 to point to the cell in row 8, column 5. Set B10=3 to C10=3 to change the position of the square." _ & "Set B12=8, C12=3 to resize. Press YZ to see the result. Press >>C to rotate the coordinate system. Remove the minus sign at B7, B7=114. Press >>C again to see the difference." Range("AE227").Value = "This cell indicates the initial position on the Z axis of the current vector. When working in FIELD mode, the code automatically deletes the data in this cell and replaces it with =C11, since in C11 will traverse (in field mode) all the initial values of the Z coordinates of the given field vectors for a range in the Z coordinate. In this cell the user can enter constant values as well as functions." _ & Chr(13) & Chr(13) & " To see how it works, in a new ScienSolar sheet add a new vector and set A12 = 4, B12 = 3, C12 = 0. Press the XYZ button. Enter other values and observe the changes in the coordinate system." Range("AE228").Value = "This cell is used by the code when working in FIELD MODE to cycle through all the coordinate values as variables. In other words, this cell is equivalent to the variable z when working with a function f(z). As an example of using this cell, see the ELECTRICAL DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields, see the FUNCTIONS project." Range("AE229").Value = "In this cell the value of the coordinate on the Z axis of the vector is entered. When working in FIELD MODE, the function corresponding to the Z axis of the vector field is entered here. As an example of use of this cell see the ELECTRICAL DIPOLE, CYLINDRICAL SYMMETRY and SPHERICAL SYMMETRY projects. For scalar fields see the FUNCTIONS project." Range("AE230").Value = "Vector HISTORY cell. Possible values 1 and 2. " _ & "With the value 2 the vector will leave a trace of its path in the spreadsheet, which is visible when the vector changes position. When the value 1 is placed after having had the value 2, the old vectors will disappear from gradually when some action is executed." _ & Chr(13) & Chr(13) & "To see how it works, in a new ScienSolar sheet add a vector (by pressing the +Vector button) and enter the number 2 in cell C13=2. Press the rotate button >>C. Now change the initial positions of the vector and its coordinates and press >>C again. " _ & "You will notice that a set of vectors appears in the coordinate system. Then enter C13=1 and press >>C to see the vectors gradually disappear. Press >>C again for their complete disappearance. " _ & "If you want the vectors to disappear instantly, you must enter a value greater than 5000 in cell A8, for example A8=6000, and press any refresh button." Range("AE231").Value = "Vector thickness. The default value is 1. For thicker vectors enter a value greater than 1. Here, as in other configuration cells, dynamic formulas can be entered that change the appearance of the vectors depending on certain particular parameters for each project." 'valores predeterminados de ayuda para la columna D Range("AF323").Value = "Celda utilizada por el botn B/W para indicar el formato del fondo de la hoja. Oprima B/W para ver los cambios, este proceso no afecta en escencia los proyectos, sino que permite cambiar su apariencia. Las apariencias del fondo se pueden guardar en el cdigo de los proyectos. " Range("AE323").Value = "Cell used by the B/W button to indicate the format of the sheet background. Press B/W to see the changes, this process does not essentially affect the projects, but rather allows you to change its appearance. Background appearances can be saved in the projects code." 'valores predeterminados de ayuda para la columna E Range("AF365").Value = "Posicin horizontal, en puntos de Excel, del origen de coordenadas. Cada proyecto puede personalizar y guardar este valor en el cdigo. Al cambiar este valor, automticamente se actualizarn las posiciones de los objetos que se encuentran en el sistema de coordenadas. Las unidades en las que trabaja ScienSolar es en puntos. Para visualizar su magnitud, oprima YZ y ver la longitud del eje correspondiente a la mostrada en la celda Longitud de los ejes. " _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF366").Value = "Posicin vertical, en puntos de Excel, del origen de coordenadas. Cada proyecto puede personalizar y guardar este valor en el cdigo. Al cambiar este valor, automticamente se actualizarn las posiciones de los objetos que se encuentren en el sistema de coordenadas. Las unidades en las que trabaja ScienSolar es en puntos. Para visualizar su magnitud, oprima YZ y ver la longitud del eje correspondiente a la mostrada en la celda Longitud de los ejes." _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG, en la misma celda." Range("AF367").Value = "Escala de los vectores u objetos que se encuentran en el sistema de coordenadas. El valor 1 corresponde a la escala 1:1, es decir que los vectores estn en la misma escala de los ejes de coordenadas; un valor mayor a 1 quiere decir que las coordenadas y posiciones de los vectores se multiplicarn por ese valor. Se pueden utilizar tambin valores fraccionarios. Esta celda se utiliza en algunos casos para ajustar el proyecto al sistema de coordenadas." _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF368").Value = "Longitud de los ejes en puntos de Excel. Para visualizar su magnitud, oprima YZ y ver la longitud del eje correspondiente a la mostrada en esta celda. Todos los ejes tienen la misma longitud. Este valor puede personalizarse para cada proyecto." Range("AF369").Value = "Celda utilizada por ScienSolar para determinar el grado de modificacin de un modelo con respecto a su versin estndar. Slo acepta nmeros enteros positivos." Range("AE365").Value = "Horizontal position, in Excel points, of the coordinate origin. Each project can customize and save this value in the code. Changing this value will automatically update the positions of the system objects " _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE366").Value = "Vertical position, in Excel points, of the coordinate origin. Each project can customize and save this value in the code. Changing this value will automatically update the positions of the system objects of coordinates. The units in which ScienSolar works is in points. To view its magnitude, press YZ and you will see the length of the axis corresponding to that shown in the Length of the axes cell." _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet," Range("AE367").Value = "Scale of the vectors or objects that are in the coordinate system. The value 1 corresponds to the 1:1 scale, that is, the vectors are on the same scale as the axes of coordinates; a value greater than 1 means that the coordinates and positions of the vectors will be multiplied by that value. Fractional values can also be used. This cell is used in some cases to adjust the project to the coordinate system." _ & Chr(13) & "The default values and language of the control panel can be customized on the CONFIG sheet, in the same cell." Range("AE368").Value = "Length of the axes in Excel points. To view their magnitude, press YZ and you will see the length of the axis corresponding to the one shown in this cell. All axes have the same length. This value can be customized for each project." Range("AE369").Value = "Cell used by ScienSolar to determine the degree of modification of a model with respect to its standard version. It only accepts positive integers." 'valores predeterminados de ayuda para la columna F Range("AF405").Value = "Botn B/W (Black / White). Este botn permite cambiar el color del fondo del sistema de coordenadas. Existen tres configuraciones del fondo. El botn se puede usar en cualquier momento durante el trabajo con los proyectos y no influye sobre las ecuaciones ni los datos. Tambin es posible guardar alguna de las tres configuraciones en el cdigo para cada proyecto, de tal manera que cuando se cargue el proyecto lo haga con su fondo personalizado. Este botn est vinculado a la celda D2 para su correcto funcionamiento." Range("AF406").Value = "COLOR de las ETIQUETAS. ACTUALIZAR HOJA. Con la herramienta convencional de Excel cambie el color de fondo de esta celda y con ello cambiar el color de todas las etiquetas de los objetos que se encuentran en la hoja, incluyendo las etiquetas de los ejes. Para invisibilizar las etiquetas ponga un color igual al color del fondo. El botn que aparece en esta celda se utiliza para actualizar cambios que se hayan hecho en la configuracin del proyecto o luego de ingresar de datos. " Range("AF407").Value = "NOMBRE y COLOR del EJE X. ROTACIN en X. Con la herramienta convencional de Excel cambie el color de fondo de esta celda para cambiar el color del eje X. Tambin puede personalizar el nombre del eje X. Para invisibilizar el eje ponga aqu el mismo color del fondo. El botn >>A rotar consecutivamente el sistema de coordenadas alrededor del eje X (en la posicin YZ) el nmero de veces indicado en la celda I4 con un paso en grados indicado en la celda I3." Range("AF408").Value = "NOMBRE y COLOR del EJE Y. ROTACIN en Y. Con la herramienta convencional de Excel cambie el color de fondo de esta celda para cambiar el color del eje Y. Tambin puede personalizar el nombre del eje Y. Para invisibilizar el eje ponga aqu el mismo color del fondo. El botn >>B rotar consecutivamente el sistema de coordenadas alrededor del eje Y (en la posicin YZ) el nmero de veces indicado en la celda I4 con un paso en grados indicado en la celda I3." Range("AF409").Value = "NOMBRE y COLOR del EJE Z. ROTACIN en Z. Con la herramienta convencional de Excel cambie el color de fondo de esta celda para cambiar el color del eje Z. Tambin puede personalizar el nombre del eje Z. Para invisibilizar el eje ponga aqu el mismo color del fondo. El botn >>C rotar consecutivamente el sistema de coordenadas alrededor del eje Z (en la posicin YZ) el nmero de veces indicado en la celda I4 con un paso en grados indicado en la celda I3." Range("AE405").Value = "B/W (Black / White) button. This button allows you to change the background color of the coordinate system. There are three background settings. The button can be used at any time during work with the projects and does not influence the equations or the data. It is also possible to save any of the three configurations in the code for each project, so that when the project is loaded it does so with its personalized background. This button is linked to cell D2 for correct operation." Range("AE406").Value = "COLOR of the LABELS. UPDATE SHEET. With the conventional Excel tool change the background color of this cell and with this it will change the color of all the labels of the objects that are in the sheet, including the axis labels. To make the labels invisible, set a color equal to the background color. The button that appears in this cell is used to update changes that have been made in the project configuration or after entering data. " Range("AE407").Value = "NAME and COLOR of the X AXIS. ROTATION in X. With the Excel conventional tool change the background color of this cell to change the color of the X axis. You can also customize the name of the axis X. To make the axis invisible, put the same background color here. The >>A button will consecutively rotate the coordinate system around the X axis (in the YZ position) the number of times indicated in cell I4 with a step in degrees indicated in cell I3" Range("AE408").Value = "NAME and COLOR of the Y AXIS. ROTATION in Y. With the Excel conventional tool change the background color of this cell to change the color of the Y axis. You can also customize the name of the axis Y. To make the axis invisible, put the same background color here. The >>B button will consecutively rotate the coordinate system around the Y axis (in the YZ position) the number of times indicated in cell I4 with a step in degrees indicated in cell I3." Range("AE409").Value = "NAME and COLOR of the Z AXIS. ROTATION in Z. With the Excel conventional tool change the background color of this cell to change the color of the Z axis. You can also customize the name of the axis Z. To make the axis invisible, put the same background color here. The >>C button will consecutively rotate the coordinate system around the Z axis (in the YZ position) the number of times indicated in cell I4 with a step in degrees indicated in cell I3." 'valores predeterminados de ayuda para la columna G Range("AF446").Value = "Vista XYZ personalizada, con rotacin en x de o, en y de 15 y en z de 15 grados. " _ & Chr(13) & "Vista YZ personalizada, con rotacin en x de 0, en y de 0 y en z de 0 grados. " _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG, en la misma celda." Range("AF447").Value = "Vista XY personalizada desde ARRIB con rotacin en x de 0, en y de 90 y en z de 0 grados. " _ & Chr(13) & "Vista XZ personalizada, con rotacin en x de 0, en y de 0 y en z de 90 grados. " _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF448").Value = "Vista personalizada de rotacin en X. Luego de personalizar el ngulo de rotacin en X (en grados), para ver los cambios oprima el botn ubicado en F3." _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF449").Value = "Vista personalizada de rotacin en Y. Luego de personalizar el ngulo de rotacin en Y (en grados), para ver los cambios oprima el botn ubicado en F3." _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF450").Value = "Vista personalizada de rotacin en Z. Luego de personalizar el ngulo de rotacin en Z (en grados), para ver los cambios oprima el botn ubicado en F3." _ & Chr(13) & "Los valores predeterminados y el lenguaje del panel del control se pueden personalizar en la hoja CONFIG." Range("AF451").Value = "MEN DE AYUDA: " _ & Chr(13) & " 1. Seleccione la celda de la que necesita ayuda." _ & Chr(13) & " 2. Oprima el botn de ayuda (?)." _ & Chr(13) & " 3. Para ayuda sobre un botn seleccione la celda bajo este y oprima el botn de ayuda (?)." _ & Chr(13) & " 4. Para ocultar la ayuda oprima el botn que se encuentra en F3." _ & Chr(13) & Chr(13) & " Para consultar sobre un proyecto especfico, coloque el cursor sobre la celda HELP y lea el comentario emergente." Range("AE446").Value = "Custom XYZ view, with rotation in x of 0, in y of 15 and in z of 15 degrees. " _ & Chr(13) & "Custom YZ view, with rotation in x of 0, in y of 0 and in z of 0 degrees. " _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE447").Value = "Custom XY view from ABOVE with rotation in x of 0, in y of 90 and in z of 0 degrees. " _ & Chr(13) & "Custom XZ view, with rotation in x of 0, in y of 0 and in z of 90 degrees. " _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE448").Value = "Custom X rotation view. After customizing the X rotation angle (in degrees), to see the changes press the button located at F3." _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE449").Value = "Custom Y rotation view. After customizing the Y rotation angle (in degrees), to see the changes press the button located at F3." _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE450").Value = "Custom Z rotation view. After customizing the Z rotation angle (in degrees), to see the changes press the button located at F3." _ & Chr(13) & "The default values and language of the control panel can be customized in the CONFIG sheet." Range("AE451").Value = "HELP MENU: " _ & Chr(13) & " 1. Select the cell you need help with." _ & Chr(13) & " 2. Press the help button (?)." _ & Chr(13) & " 3. For help on a button, select the cell below it and press the help button (?)." _ & Chr(13) & " 4. To hide the help press the button located at F3." _ & Chr(13) & Chr(13) & " To inquire about a specific project, place the cursor over the HELP cell and read the pop-up comment." 'valores predeterminados de ayuda para la columna I Range("AF493").Value = "En esta celda se introduce el valor del paso para una simulacin dinmica, en donde cierto parmetro del modelo puede cambiar consecutivamente, como por ejemplo el parmetro del tiempo, en este caso aqu se introduce la unidad del tiempo, es decir 1. De forma preestablecida se introduce el valor predeterminado en la hoja CONFIG, pero usted puede cambiar este valor por el que sea necesario para su modelo. El nmero 8 preestablecido corresponde a 8 grados, pues 8 x 45 = 360, lo cual se utiliza frecuentemente para la rotacin de los ejes." Range("AF494").Value = "En esta celda se introduce el nmero de pasos para una simulacin dinmica, en donde cierto parmetro del modelo puede cambiar consecutivamente, como por ejemplo el parmetro del tiempo, en este caso aqu se introduce la cantidad de segundos que durar la simulacin, por defecto 45. De forma preestablecida se introduce el valor predeterminado en la hoja CONFIG, pero usted puede cambiar este valor por el que sea necesario para su modelo. El nmero 45 preestablecido se ajusta en grados a una vuelta completa, pues 8 x 45 = 360, lo cual se utiliza frecuentemente para la rotacin de los ejes." Range("AF495").Value = "En esta celda se introduce el parmetro para una simulacin dinmica, el cual puede cambiar consecutivamente, como por ejemplo el parmetro del tiempo, en este caso aqu se introduce la variable t, es decir esta celda debe tener el lugar de la variable t de una ecuacin matemtica dinmica. Como ilustracin del funcionamiento de esta celda se puede ver el proyecto MOVIMIENTO PARABLICO." Range("AE493").Value = "In this cell the step value is entered for a dynamic simulation, where a certain model parameter can change consecutively, such as the time parameter, in this case the unit of time is entered here, that is, 1. By default, the value from the CONFIG sheet is entered, but you can change this value to whatever is necessary for your model. The preset number 8 corresponds to 8 degrees, since 8 x 45 = 360, which is frequently used for the rotation of the axes." Range("AE494").Value = "In this cell you enter the number of steps for a dynamic simulation, where a certain model parameter can change consecutively, such as the time parameter, where the number of seconds of the simulation is entered in this cell, by default 45. By default the value from the CONFIG sheet is entered, but you can change this value to whatever is necessary for your model. The preset number 45 is set in degrees to one full revolution , since 8 x 45 = 360, which is frequently used for the rotation of the axes." Range("AE495").Value = "In this cell the parameter for a dynamic simulation is entered, which can change consecutively, such as the time parameter, in this case the variable t is entered here, that is, this cell must take the place of the variable t of a dynamic mathematical equation. As an illustration of the functioning of this cell, you can see the project PARABOLIC MOTION." 'valores predeterminados de ayuda para la columna J Range("AF497").Value = "El botn ubicado en esta celda est destinado a ocultar o mostrar las columnas de configuracin de los vectores y del modelo, es decir las primeras 5 columnas. " Range("AF498").Value = "Al oprimir este botn, la celda activa en la hoja actuar como parmetro dinmico avanzando. Para ver su funcionamiento seleccione una celda que no est ocupada y oprima este botn, observar que la celda cambia su valor consecutivamente. Este botn es til para verificar rpidamente el comportamiento de variables de un modelo con diferentes valores, simplemente seleccionando la celda de la variable y oprimiendo este botn. " Range("AF499").Value = "Al oprimir este botn, la celda activa en la hoja actuar como parmetro dinmico retrocediendo. Para ver su funcionamiento seleccione una celda que no est ocupada y oprima este botn, observar que la celda cambia su valor consecutivamente. Este botn es til para verificar rpidamente el comportamiento de variables de un modelo con diferentes valores, simplemente seleccionando la celda de la variable y oprimiendo este botn. " Range("AF500").Value = "<<-- poner el parmetro dinmico en cero. " & Chr(13) & "<- retroceder un paso." Range("AE497").Value = "The button located in this cell is intended to hide or show the vector and model configuration columns, that is, the first 5 columns." Range("AE498").Value = "When you press this button, the active cell in the spreadsheet will act as a dynamic forward parameter. To see how it works, select an empty cell and press this button, you will notice that the cell changes its value consecutively. This button is useful to quickly check the behavior of variables in a model with different values, simply by selecting the variable cell and pressing this button." Range("AE499").Value = "When you press this button, the active cell in the spreadsheet will act as a dynamic back parameter. To see how it works, select an empty cell and press this button, you will notice that the cell changes its value consecutively. This button is useful to quickly check the behavior of variables in a model with different values, simply by selecting the variable cell and pressing this button." Range("AE500").Value = "<<-- sets the dynamic parameter to zero. " & Chr(13) & "<- goes back one step." 'valores predeterminados de ayuda para la columna K Range("AF502").Value = "Botn de ayuda. Seleccione cualquier celda en la hoja y oprima este botn para obtener ayuda sobre la celda seleccionada. " Range("AF503").Value = "Comentario de ayuda. Coloque el cursor sobre esta celda para obtener ayuda sobre el proyecto en curso. Para editar la informacin del comentario y personalizarla para su propio proyecto, oprima el botn derecho del ratn y seleccione EDITAR COMENTARIO. La informacin nueva o editada solamente se guardar despus de oprimir el botn CDIGO." Range("AF504").Value = "Versin actual del paquete ScienSolar." Range("AF505").Value = "Ejecutar una simulacin. Este botn slo funciona si la celda I5 est ligada a una variable o parmetro. Para ver su funcin con ms detalle, abra una nueva hoja y descargue el proyecto MOVIMIENTO PARABLICO, seleccione la celda B39 correspondiente a la componente en el eje y de la velocidad, observe que su frmula est ligada con la celda I5 mediante la ecuacin v_y = v_oy + a_y t." Range("AE502").Value = "Help button. Select any cell on the sheet and press this button to get help on the selected cell." Range("AE503").Value = "Help comment. Place the cursor over this cell for help on the current project. To edit the comment information and customize it for your own project, right-click and select EDIT COMMENT. New or edited information will only be saved after pressing the CODE button." Range("AE504").Value = "Current version of the ScienSolar package." Range("AE505").Value = "Run a simulation. This button only works if cell I5 is linked to a variable or parameter. To see its function in more detail, open a new sheet and download the PARABOLIC MOTION project, select cell B39 corresponding to the y-axis component of velocity, note that its formula is linked to cell I5 by the equation v_y = v_oy + a_y t." 'valores predeterminados de ayuda para la columna L Range("AF510").Value = " -->> poner el parmetro dinmico en su ltimo valor. " & Chr(13) & "adelantar un paso." Range("AE510").Value = " -->> set the dynamic parameter to its last value. " & Chr(13) & "advance one step." 'valores predeterminados de ayuda para la columna O Range("AF522").Value = "Manuales y libros sobre los modelos de ScienSolar. Encuentre en este vnculo los manuales y libros en espaol e ingls, y a futuro en otros idiomas, sobre cmo sacar mejor provecho de este paquete para sus propios modelos de fsica y matemticas. Los libros se ofrecen en versiones de papel y versiones de lectura en lnea. " Range("AE522").Value = "Manuals and books on the ScienSolar models. Find at this link the manuals and books in Spanish and English, and in the future in other languages, on how to get the most out of this package for your own models of physics and mathematics. The books are offered in print versions and online reading versions." 'valores predeterminados de ayuda para la columna P Range("AF527").Value = "Manuales y libros sobre los modelos de ScienSolar. Encuentre en este vnculo los manuales y libros en espaol e ingls, y a futuro en otros idiomas, sobre cmo sacar mejor provecho de este paquete para sus propios modelos de fsica y matemticas. Los libros se ofrecen en versiones de papel y versiones de lectura en lnea. " Range("AF530").Value = "Oprima este botn para abrir una nueva hoja de clculo para un nuevo proyecto o para abrir otros proyectos ScienSolar. Cada hoja es totalmente independiente y pueden abrirse varias hojas simultneamente sin que esto afecte a los proyectos ya abiertos. " Range("AE527").Value = "Manuals and books on the ScienSolar models. Find at this link the manuals and books in Spanish and English, and in the future in other languages, on how to get the most out of this package for your own models of physics and mathematics. The books are offered in print versions and online reading versions." Range("AE530").Value = "Press this button to open a new spreadsheet for a new project or to open other ScienSolar projects. Each sheet is completely independent and multiple sheets can be opened simultaneously without affecting already open projects " 'valores predeterminados de ayuda para la columna Q Range("AF535").Value = "Lista de proyectos. Para que un proyecto aparezca en esta lista se deben cumplir dos requisitos. 1. Que se encuentre listado en la hoja CONFIG. 2. Que su cdigo se encuentre en el editor VBA del libro de Excel, con su encabezado configurado correctamente. Cada proyecto puede tener diferentes versiones de acuerdo a su idioma, cada una de ellas con su propio cdigo y su encabezado distinguido por el acrnimo del idioma (por ejemplo EN, ES, etc.)" Range("AE535").Value = "List of projects. For a project to appear in this list, two requirements must be met. 1. It must be listed on the CONFIG sheet. 2. Its code must be in the book's VBA editor of Excel, with its header configured correctly. Each project can have different versions depending on its language, each of them with its own code and its header distinguished by the language acronym (for example EN, ES, etc.)" 'valores predeterminados de ayuda para la columna R Range("AF540").Value = "Lista de proyectos. Para que un proyecto aparezca en esta lista se deben cumplir dos requisitos. 1. Que se encuentre listado en la hoja CONFIG. 2. Que su cdigo se encuentre en el editor VBA del libro de Excel, con su encabezado configurado correctamente. Cada proyecto puede tener diferentes versiones de acuerdo a su idioma, cada una de ellas con su propio cdigo y su encabezado distinguido por el acrnimo del idioma (por ejemplo EN, ES, etc.)" Range("AE540").Value = "List of projects. For a project to appear in this list, two requirements must be met. 1. It must be listed on the CONFIG sheet. 2. Its code must be in the book's VBA editor of Excel, with its header configured correctly. Each project can have different versions depending on its language, each of them with its own code and its header distinguished by the language acronym (for example EN, ES, etc.)" 'valores predeterminados de ayuda para la columna S Range("AF542").Value = "La funcin del botn Restablecer es eliminar todo el contenido actual de la hoja de clculo y volver a la configuracin de una hoja nueva. Esta accin es irreversible pero slo afecta los cambios hechos despus de haber abierto un proyecto. Los proyectos ya guardados en ScienSolar mediante el copiado de cdigo al editor de VBA no son afectados por la accin de este botn." Range("AF545").Value = "Lista de proyectos. Para que un proyecto aparezca en esta lista se deben cumplir dos requisitos. 1. Que se encuentre listado en la hoja CONFIG. 2. Que su cdigo se encuentre en el editor VBA del libro de Excel, con su encabezado configurado correctamente. Cada proyecto puede tener diferentes versiones de acuerdo a su idioma, cada una de ellas con su propio cdigo y su encabezado distinguido por el acrnimo del idioma (por ejemplo EN, ES, etc.)" Range("AE542").Value = "The function of the Reset button is to delete all the current content of the spreadsheet and return to the settings of a new sheet. This action is irreversible but only affects changes made after having opened a project. Projects already saved in ScienSolar by copying the code to the VBA editor are not affected by the action of this button." Range("AE545").Value = "List of projects. For a project to appear in this list, two requirements must be met. 1. It must be listed on the CONFIG sheet. 2. Its code must be in the book's VBA editor of Excel, with its header configured correctly. Each project can have different versions depending on its language, each of them with its own code and its header distinguished by the language acronym (for example EN, ES, etc.)" 'valores predeterminados de ayuda para la columna T Range("AF547").Value = "Idioma de la interface y del proyecto actual. Seleccione el idioma preferido y oprima Ejecutar. Para guardar un proyecto en un nuevo idioma, abra el proyecto en el idioma existente, edtelo en el nuevo idioma y antes de exportarlo con el botn CDIGO, seleccione el nuevo idioma de la lista desplegable. Luego de exportado, copie el cdigo del archivo exportado y pguelo en el editor de VBA. Para versiones de lenguaje del mismo proyecto, no necesita adicionarlo a la lista de proyectos en CONFIG, solamente agregar la traduccin del ttulo en la correspondiente columna. " Range("AF550").Value = "El botn vector tiene dos funciones: 1. Si la lista de proyectos no tiene seleccionado ningn proyecto, este botn agregar un nuevo vector. 2. Si la lista tiene seleccionado un proyecto, el proyecto seleccionado se cargar a la hoja. Nota: existen proyectos grandes que necesitan cargarse por partes, as que tendr que oprimirse varias veces eeste botn, estos proyectos grandes tienen ms de 20 vectores en su configuracin. Si ya existe un proyecto en la hoja de clculo y se desea cargar otro proyecto, es necesario restablecer la hoja. No se pueden cargar dos proyectos a una misma hoja. " Range("AE547").Value = "Language of the interface and the current project. Select the preferred language and press Run. To save a project in a new language, open the project in the existing language, edit it in the new language and before exporting it with the CODE button, select the new language from the drop-down list. After exporting, copy the code from the exported file and paste it into the VBA editor. For language versions of the same project, you do not need to add it to the list of projects in CONFIG, just add the translation of the title in the corresponding column. " Range("AE550").Value = "The vector button has two functions: 1. If the project list has no project selected, this button will add a new vector. 2. If the list has a project selected, the selected project will be loaded to the sheet. Note: there are large projects that need to be loaded in parts, so you will have to press this button several times, these large projects have more than 20 vectors in their configuration. If a project already exists in the spreadsheet and If you want to load another project, you must reset the sheet. You cannot load two projects to the same sheet." 'Valores predeteminados del panel de control. Range("A2").FormulaR1C1 = "INICIO" Range("A31").FormulaR1C1 = "(Yes=1,No=0)" Range("A32").FormulaR1C1 = "AUTOLIST:" Range("A33").FormulaR1C1 = "0" Range("A35").FormulaR1C1 = "Press below" Range("A36").FormulaR1C1 = "to refresh" Range("A37").FormulaR1C1 = "the list in" Range("A38").FormulaR1C1 = "the active" Range("A39").FormulaR1C1 = "language." Range("A40").FormulaR1C1 = "Put A33=1" Range("A41").FormulaR1C1 = "to refresh" Range("A42").FormulaR1C1 = "with the " Range("A43").FormulaR1C1 = "Reset" Range("A44").FormulaR1C1 = "button." Range("A45").FormulaR1C1 = "1" Range("A49").FormulaR1C1 = "Obs." Range("A49").AddComment Range("A49").Comment.Visible = False Range("A49").Comment.Shape.width = 300 Range("A49").Comment.Shape.height = 300 Range("A49").Comment.text text:="REFRESH BUTON (Useful when adding new models)" & Chr(10) & Chr(10) _ & "ENGLISH: For this button to work properly, you must check the box Trust access to the VBA project object model, in Excel, under Options -> Trust Center -> Macro Settings." _ & Chr(10) & Chr(10) & "SPANISH: Para que este bot" & ChrW(243) & "n funcione correctamente, debe marcar la casilla Confiar en el acceso al modelo de objetos del proyecto VBA, en Excel, en Opciones --> Centro de confianza --> Configuraci" & ChrW(243) & "n de macros." Range("B1").FormulaR1C1 = "This sheet contains the default values; Be careful when making changes. Anyway, to reset all initial settings, delete this spreadsheet (CONFIG) and press the New Sheet button (from another sheet)." Range("B3:B5").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[8]C[1])" Range("B33:B71").FormulaR1C1 = "=HLOOKUP(R2C17,R33C5:R150C11,RC[1])" Range("C2:C3").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[12]C)" Range("D2:D6").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[14]C[-1])" For i = 11 To 31 Cells(i, "C").Value = i - 8 Next i For i = 33 To 71 Cells(i, "C").Value = i - 32 Next i Range("B2").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[27]C[1])" Range("B32").FormulaR1C1 = "(LISTA)" Range("C10").FormulaR1C1 = "Verified translation" Range("C32").FormulaR1C1 = "No, of list" Range("D10").FormulaR1C1 = "Note: Please do not change the labels LISTA and INICIO, they are necessary for the correct running of the program." Range("D11").FormulaR1C1 = "Obs: por favor no cambie los nombres LISTA e INICIO, pues son necesarios para el correcto funcionamiento del programa." Range("E3").FormulaR1C1 = "850" Range("E4").FormulaR1C1 = "400" Range("E5").FormulaR1C1 = "20" Range("E6").FormulaR1C1 = "200" Range("E8").FormulaR1C1 = "=R3C17" Range("E9").FormulaR1C1 = "1" Range("E10").FormulaR1C1 = "0" Range("E11").FormulaR1C1 = "Get code" Range("E12").FormulaR1C1 = " +Obj" Range("E13").FormulaR1C1 = " -Obj" Range("E14").FormulaR1C1 = " New sheet " Range("E15").FormulaR1C1 = " + Vector" Range("E16").FormulaR1C1 = "Origin" Range("E17").FormulaR1C1 = "Left:" Range("E18").FormulaR1C1 = "Up:" Range("E19").FormulaR1C1 = "Scale:" Range("E20").FormulaR1C1 = "Axes lenght:" Range("E21").FormulaR1C1 = "Rotation" Range("E22").FormulaR1C1 = "Dynamic parameters" Range("E23").FormulaR1C1 = "Step:" Range("E24").FormulaR1C1 = "No. steps:" Range("E25").FormulaR1C1 = "Parameter:" Range("E26").FormulaR1C1 = "Selected" Range("E27").FormulaR1C1 = "Set to zero" Range("E28").FormulaR1C1 = "Split the text of the selected cell" Range("E29").FormulaR1C1 = "Reset" Range("E30").FormulaR1C1 = "New Vector" Range("E31").FormulaR1C1 = "Clone all" Range("E32").FormulaR1C1 = "=R3C17" Range("E33").FormulaR1C1 = "1" Range("E34").FormulaR1C1 = "(DO) Partial Differential Operators" Range("E35").FormulaR1C1 = "Vector Addition" Range("E36").FormulaR1C1 = "Vector Coordinates" Range("E37").FormulaR1C1 = "Cross Product" Range("E38").FormulaR1C1 = "Unit Vector" Range("E39").FormulaR1C1 = "Rotation of a Vector" Range("E40").FormulaR1C1 = "Composite Rotation" Range("E41").FormulaR1C1 = "Tangential Rotation" Range("E42").FormulaR1C1 = "Cylindrical Coordinates" Range("E43").FormulaR1C1 = "Spherical Coordinates" Range("E44").FormulaR1C1 = "Plane Symmetry" Range("E45").FormulaR1C1 = "Cylindrical Symmetry" Range("E46").FormulaR1C1 = "Spherical Symmetry" Range("E47").FormulaR1C1 = "TRAJECTORY" Range("E48").FormulaR1C1 = "Parabolic Movement" Range("E49").FormulaR1C1 = "3D Model" Range("E50").FormulaR1C1 = "Lens" Range("E51").FormulaR1C1 = "3D Pyramid" Range("E52").FormulaR1C1 = "PV = NkT" Range("E53").FormulaR1C1 = "Functions" Range("E54").FormulaR1C1 = "ScienSolar" Range("E55").FormulaR1C1 = "Battery" Range("E56").FormulaR1C1 = "Coulomb Force" Range("E57").FormulaR1C1 = "Electric Field" Range("E58").FormulaR1C1 = "Magnetic Force" Range("E59").FormulaR1C1 = "Loop in a Magnetic Field" Range("E60").FormulaR1C1 = "Biot-Savart Law" Range("E61").FormulaR1C1 = "Charge distributions" Range("E62").FormulaR1C1 = "Electric Field of nuclear particles" Range("E63").FormulaR1C1 = "Plane wave" Range("E64").FormulaR1C1 = "Toroid" Range("E65").FormulaR1C1 = "Example of D. O." Range("E66").FormulaR1C1 = "Magnetic field of a loop dL" Range("E67").FormulaR1C1 = "Potential of point charges" Range("E68").FormulaR1C1 = "Lorentz Force" Range("E69").FormulaR1C1 = "Coulomb Force charge-line" Range("E70").FormulaR1C1 = "Paraboloid" Range("E71").FormulaR1C1 = "Field Flux, Gausss Law " Range("F2").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[19]C[-3])" Range("F4").FormulaR1C1 = "x" Range("F5").FormulaR1C1 = "y" Range("F6").FormulaR1C1 = "z" Range("F8").FormulaR1C1 = "=R4C17" Range("F9").FormulaR1C1 = "2" Range("F10").FormulaR1C1 = "1" Range("F11").FormulaR1C1 = "C" & ChrW(243) & "digo" Range("F12").FormulaR1C1 = " +Obj" Range("F13").FormulaR1C1 = " -Obj" Range("F14").FormulaR1C1 = "Nueva hoja" Range("F15").FormulaR1C1 = " + Vector" Range("F16").FormulaR1C1 = "Origen" Range("F17").FormulaR1C1 = "Izquierda:" Range("F18").FormulaR1C1 = "Arriba:" Range("F19").FormulaR1C1 = "Escala:" Range("F20").FormulaR1C1 = "Long. ejes " Range("F21").FormulaR1C1 = "Rotaci" & ChrW(243) & "n" Range("F22").FormulaR1C1 = "Par" & ChrW(225) & "metros din" & ChrW(225) & "micos" Range("F23").FormulaR1C1 = "Paso:" Range("F24").FormulaR1C1 = "N de pasos:" Range("F25").FormulaR1C1 = "Par" & ChrW(225) & "metro:" Range("F26").FormulaR1C1 = " Seleccionado" Range("F27").FormulaR1C1 = "Reiniciar" Range("F28").FormulaR1C1 = "Repartir el texto de la celda seleccionada" Range("F29").FormulaR1C1 = "Restablecer" Range("F30").FormulaR1C1 = "Nuevo vector" Range("F31").FormulaR1C1 = "Clonar todo" Range("F32").FormulaR1C1 = "=R4C17" Range("F33").FormulaR1C1 = "2" Range("F34").FormulaR1C1 = "(DO) Opradores diferenciales parciales" Range("F35").FormulaR1C1 = "Suma de vectores" Range("F36").FormulaR1C1 = "Coordenadas de vectores" Range("F37").FormulaR1C1 = "Producto cruz" Range("F38").FormulaR1C1 = "Vector unitario" Range("F39").FormulaR1C1 = "Rotaci" & ChrW(243) & "n de un vector" Range("F40").FormulaR1C1 = "Rotaci" & ChrW(243) & "n compuesta" Range("F41").FormulaR1C1 = "Rotaci" & ChrW(243) & "n tangencial" Range("F42").FormulaR1C1 = "Coordenadas cil" & ChrW(237) & "ndricas" Range("F43").FormulaR1C1 = "Coordenadas esf" & ChrW(233) & "ricas" Range("F44").FormulaR1C1 = "Simetr" & ChrW(237) & "a plana" Range("F45").FormulaR1C1 = "Simetr" & ChrW(237) & "a cil" & ChrW(237) & "ndrica" Range("F46").FormulaR1C1 = "Simetr" & ChrW(237) & "a esf" & ChrW(233) & "rica" Range("F47").FormulaR1C1 = "TRAJECTORY" Range("F48").FormulaR1C1 = "Movimiento parab" & ChrW(243) & "lico" Range("F49").FormulaR1C1 = "Modelo 3D" Range("F50").FormulaR1C1 = "Lente" Range("F51").FormulaR1C1 = "Pir" & ChrW(225) & "mide 3D" Range("F52").FormulaR1C1 = "PV = NkT" Range("F53").FormulaR1C1 = "Funciones" Range("F54").FormulaR1C1 = "ScienSolar" Range("F55").FormulaR1C1 = "Bateria" Range("F56").FormulaR1C1 = "Fuerza de Coulomb" Range("F57").FormulaR1C1 = "Campo el" & ChrW(233) & "ctrico" Range("F58").FormulaR1C1 = "Fuerza magn" & ChrW(233) & "tica" Range("F59").FormulaR1C1 = "Espira en un campo magn" & ChrW(233) & "tico" Range("F60").FormulaR1C1 = "Ley de Biot - Savart" Range("F61").FormulaR1C1 = "Distribuciones de carga" Range("F62").FormulaR1C1 = "Campo E de part" & ChrW(237) & "culas" Range("F63").FormulaR1C1 = "Onda plana" Range("F64").FormulaR1C1 = "Toroide" Range("F65").FormulaR1C1 = "Ejemplos de O. D." Range("F66").FormulaR1C1 = "Campo magn" & ChrW(233) & "tico de una espira" Range("F67").FormulaR1C1 = "Potencial de cargas puntuales" Range("F68").FormulaR1C1 = "Fuerza de lorentz" Range("F69").FormulaR1C1 = "Fuerza de Coulomb carga-linea" Range("F70").FormulaR1C1 = "Paraboloide" Range("F71").FormulaR1C1 = "Ley de Gauss, Flujo E" Range("G4").FormulaR1C1 = "0" Range("G5").FormulaR1C1 = "15" Range("G6").FormulaR1C1 = "15" Range("G8").FormulaR1C1 = "=R5C17" Range("G9").FormulaR1C1 = "3" Range("G10").FormulaR1C1 = "0" Range("G29").FormulaR1C1 = "Reset" Range("G32").FormulaR1C1 = "=R5C17" Range("G33").FormulaR1C1 = "3" Range("G34").FormulaR1C1 = "0" Range("H2").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[20]C[-5])" Range("H3").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[20]C[-5])" Range("H4").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[20]C[-5])" Range("H5").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[20]C[-5])" Range("H8").FormulaR1C1 = "=R6C17" Range("H9").FormulaR1C1 = "4" Range("H10").FormulaR1C1 = "0" Range("H29").FormulaR1C1 = "Reset" Range("H32").FormulaR1C1 = "=R6C17" Range("H33").FormulaR1C1 = "4" Range("H34").FormulaR1C1 = "0" Range("I3").FormulaR1C1 = "8" Range("I4").FormulaR1C1 = "45" Range("I5").FormulaR1C1 = "0" Range("I8").FormulaR1C1 = "=R7C17" Range("I9").FormulaR1C1 = "5" Range("I10").FormulaR1C1 = "0" Range("I29").FormulaR1C1 = "Reset" Range("I32").FormulaR1C1 = "=R7C17" Range("I33").FormulaR1C1 = "5" Range("I34").FormulaR1C1 = "0" Range("J2").FormulaR1C1 = "=HLOOKUP(RC[7],R9C5:R31C12,R[28]C[-7])" Range("J3").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[23]C[-7])" Range("J4").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[23]C[-7])" Range("J5").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[23]C[-7])" Range("J8").FormulaR1C1 = "=R8C17" Range("J9").FormulaR1C1 = "6" Range("J10").FormulaR1C1 = "0" Range("J29").FormulaR1C1 = "Reset" Range("J32").FormulaR1C1 = "=R8C17" Range("J33").FormulaR1C1 = "6" Range("J34").FormulaR1C1 = "0" Range("K2").FormulaR1C1 = "=HLOOKUP(R2C17,R9C5:R31C12,R[29]C[-8])" Range("K8").FormulaR1C1 = "=R9C17" Range("K9").FormulaR1C1 = "7" Range("K10").FormulaR1C1 = "0" Range("K29").FormulaR1C1 = "Reset" Range("K32").FormulaR1C1 = "=R9C17" Range("K33").FormulaR1C1 = "7" Range("K34").FormulaR1C1 = "0" Range("N15").FormulaR1C1 = "Note: Please do not change the labels LISTA and INICIO, they are necessary for the correct running of the program." Range("N16").FormulaR1C1 = "Obs: por favor no cambie los nombres LISTA e INICIO, pues son necesarios para el correcto funcionamiento del programa." Range("N18").FormulaR1C1 = "FIRST USE INSTRUCTIONS:" Range("N20").FormulaR1C1 = "1. Press button New Sheet and, in the new sheet select a project from the drop-down list." Range("N21").FormulaR1C1 = "2. Press the + Vector button." Range("N22").FormulaR1C1 = "3. Customize the model." Range("N23").FormulaR1C1 = "4. View the model via the rotate buttons or run it via the Run button." Range("N24").FormulaR1C1 = "5. To select a new project, first press Reset." Range("N25").FormulaR1C1 = "6. To add new vectors, select blank from the drop-down list and press the +Vector button." Range("N28").FormulaR1C1 = "INSTRUCCIONES DE INICIO:" Range("N30").FormulaR1C1 = "1. Presione el bot" & ChrW(243) & "n New Sheet y luego en la nueva hoja seleccione un proyecto de la lista desplegable." Range("N31").FormulaR1C1 = "2. Presione el bot" & ChrW(243) & "n +Vector." Range("N32").FormulaR1C1 = "3. Personalice el modelo." Range("N33").FormulaR1C1 = "4. Con los botones de rotaci" & ChrW(243) & "n visualice y con el bot" & ChrW(243) & "n Run ejecute el modelo." Range("N34").FormulaR1C1 = "5. Para seleccionar un nuevo proyecto, primero oprima el bot" & ChrW(243) & "n Reset" Range("N35").FormulaR1C1 = "6. Para agregar nuevos vectores, no seleccione ning" & ChrW(250) & "n proyecto y oprima +Vector." Range("Q1").FormulaR1C1 = "(LENGUAJE)" Range("Q2").FormulaR1C1 = "1" Range("Q3").FormulaR1C1 = "English" Range("Q4").FormulaR1C1 = "Spanish" Range("Q5").FormulaR1C1 = "Russian" Range("Q6").FormulaR1C1 = "Chinese" Range("Q7").FormulaR1C1 = "Italian" Range("Q8").FormulaR1C1 = "French" Range("Q9").FormulaR1C1 = "A" Range("R3").FormulaR1C1 = "EN" Range("R4").FormulaR1C1 = "ES" Range("R5").FormulaR1C1 = "RU" Range("R6").FormulaR1C1 = "ZH" Range("R7").FormulaR1C1 = "IT" Range("R8").FormulaR1C1 = "FR" Range("R9").FormulaR1C1 = "A" Range("P2").FormulaR1C1 = "SELECTED:" For i = 3 To 9 Range("P" & i).FormulaR1C1 = i - 2 Next i 'Termina valores predeterminados Range("C2:I6").Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlInsideHorizontal) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With Range("D10").FormulaR1C1 = _ "Note: Please do not change the labels LISTA and INICIO, they are necessary for the correct running of the program." Range("D11").FormulaR1C1 = _ "Obs: por favor no cambie los nombres LISTA e INICIO, pues son necesarios para el correcto funcionamiento del programa." Range("D12").Select ActiveSheet.Buttons.Add(20, 120, 96, 21.75).Select Selection.OnAction = "NewSheet" Selection.Characters.text = "New Sheet" ActiveSheet.Buttons.Add(0, Range("A47").Top, 62, 30).Select Selection.name = "RefreshList" Selection.OnAction = "CheckIfProjectExists" Selection.Characters.text = "REFRESH" ActiveSheet.DropDowns.Add(0, Range("A45").Top, 62, 15).Select With Selection .name = "LangList2" .LinkedCell = Range("A45").Address .DropDownLines = 20 .Display3DShading = True i = 0 Do While Sheets("CONFIG").Cells(3 + i, 16) <> "" .AddItem Sheets("CONFIG").Cells(3 + i, 17).Value i = i + 1 Loop End With Range("A45").FormulaR1C1 = "1" Range("B17").Select salida: Sheets.Add Range("A2").Value = "INICIO" Init Range("D2").Value = 1 BlackWhiteDesk ActiveWindow.Zoom = 90 Application.ScreenUpdating = True MsgBox ActiveSheet.name & " has been added. " Set sheet = Nothing End Sub Sub CleanSheet() Dim result As String result = MsgBox("This action will remove all data and vectors from the current sheet, leaving only the coordinate system at its default settings. Do you wish to continue?", vbYesNo, "All data will be removed!") If result = "6" Then Init Range("D2").Value = 1 BlackWhiteDesk Else End If End Sub Sub About() Dim Pro As Variant Pro = "" If Range("L5").Value = 1 Then Pro = " Pro" MsgBox "Version 1.62 " & Pro & " - 02-2026 " & Chr(13) & Chr(10) & " Ariel R. Becerra B 2022" _ & Chr(13) & "www.sciensolar.com" & Chr(13) _ & "arik@fisica.ru" _ & Chr(13) & Chr(13) & "By downloading the package you agree to the terms and conditions under the license" _ & " GNU General Public License v.3.0 (https://www.gnu.org/licenses/gpl-3.0.html)." _ & " You may use the ScienSolar package only under the terms of this license." _ & " To download the user manual, updates, physics problem models and other books on ScienSolar visit www.sciensolar.com." _ & Chr(13) & Chr(13) & "Al descargar el paquete, usted acepta los t" & ChrW(233) & "rminos y condiciones de la licencia" _ & " GNU General Public License v.3.0 (https://www.gnu.org/licenses/gpl-3.0.html). " _ & "Puede utilizar el paquete ScienSolar s" & ChrW(243) & "lo bajo los t" & ChrW(233) & "rminos de esta licencia." _ & " Para descargar el manual del usuario, actualizaciones, modelos de problemas y otros libros sobre ScienSolar visite www.sciensolar.com." _ & Chr(13) & Chr(13) & " Microsoft Excel version " _ & Application.Version & " running on " _ & Chr(13) & Application.OperatingSystem & "." _ , vbOKOnly, "ScienSolar " End Sub Sub HELP() ' Dim TxtMsg As String Dim TxtMsg2 As String Dim BoxLeft As Single If WorksheetFunction.And(ActiveCell.Top > 180, ActiveCell.Left > 400, ActiveCell.Left < 700) Then BoxLeft = 800 Else BoxLeft = 470 End If Dim sh As Object CheckExists ("campoHelp") If CheckExists("campoHelp") = True Then ActiveSheet.Shapes("campoHelp").Delete End If If WorksheetFunction.And(ActiveCell.Row > 41, ActiveCell.Column > 3, ActiveCell.Column < 6) Then TxtMsg = WorksheetFunction.VLookup("ZONE1", Sheets("CONFIG").Range("AA:AE"), 2, False) Else If WorksheetFunction.And(ActiveCell.Row > 41, ActiveCell.Column > 5, ActiveCell.Column < 8) Then TxtMsg = WorksheetFunction.VLookup("ZONE2", Sheets("CONFIG").Range("AA:AE"), 2, False) Else If WorksheetFunction.And(ActiveCell.Row > 5, ActiveCell.Column > 7, ActiveCell.Column < 22) Then TxtMsg = WorksheetFunction.VLookup("ZONE3", Sheets("CONFIG").Range("AA:AE"), 2, False) Else If WorksheetFunction.And(ActiveCell.Column > 21, ActiveCell.Column < 31) Then TxtMsg = WorksheetFunction.VLookup("ZONE4", Sheets("CONFIG").Range("AA:AE"), 2, False) Else If ActiveCell.Column > 30 Then TxtMsg = WorksheetFunction.VLookup("ZONE5", Sheets("CONFIG").Range("AA:AE"), 2, False) Else If WorksheetFunction.VLookup(ActiveCell.Address(0, 0), Sheets("CONFIG").Range("AA:AE"), 3, False) <> "" Then If WorksheetFunction.VLookup(ActiveCell.Address(0, 0), Sheets("CONFIG").Range("AA:AE"), 3, False) = ActiveSheet.Range("A4").Value Then TxtMsg = WorksheetFunction.VLookup(ActiveCell.Address(0, 0), Sheets("CONFIG").Range("AA:AE"), 2, False) Else TxtMsg = " [Project " & WorksheetFunction.VLookup(ActiveCell.Address(0, 0), Sheets("CONFIG").Range("AA:AE"), 3, False) & "]" End If Else TxtMsg = WorksheetFunction.VLookup(ActiveCell.Address(0, 0), Sheets("CONFIG").Range("AA:AE"), 2, False) End If End If End If End If End If End If If ActiveCell.Value <> "" Then If Left(ActiveCell.Formula, 1) <> "=" Then TxtMsg2 = "=" & ActiveCell.Value Else TxtMsg2 = ActiveCell.Formula ' & Chr(13) & ActiveCell.FormulaR1C1 & Chr(13) & "Cell(" & ActiveCell.Row & "," & ActiveCell.Column & ")" '& ActiveCell.FormulaR1C1 ' Activar para ver la formula en r1c1 End If Else TxtMsg2 = "" End If Set sh = ActiveSheet.Shapes.AddShape(114, BoxLeft, 200, 250, 800) 'otras formas sh.name = "campoHelp" With ActiveSheet.Shapes.Range(Array("campoHelp")) ' apariencia del vector .Line.BeginArrowheadStyle = 1 .Line.EndArrowheadStyle = 6 .Line.ForeColor.ObjectThemeColor = msoThemeColorAccent1 .Line.DashStyle = 1 .Line.Weight = 2 .TextFrame2.TextRange.Characters.text = ActiveCell.Address(0, 0) & TxtMsg2 & Chr(13) & Chr(13) & TxtMsg _ & Chr(13) & " _________________________ " & Chr(13) & Sheets("CONFIG").Range("AB1").Value .Fill.ForeColor.RGB = RGB(255, 255, 0) .TextFrame2.TextRange.Font.Size = 14 .TextFrame2.TextRange.Font.Fill.ForeColor.ObjectThemeColor = msoThemeColorText1 .TextFrame2.WordWrap = msoTrue .TextFrame2.AutoSize = msoAutoSizeShapeToFitText .Fill.Transparency = 0.2 .Adjustments.Item(4) = (ActiveCell.Left - .Left + 30) / .width ' posiscion de la flecha, si aplica .Adjustments.Item(3) = (ActiveCell.Top - .Top + 7) / .height 'posiscion de la flecha, si aplica End With Set sh = Nothing End Sub Function CheckExists(argName As String) As Boolean ' Verifica presencia de objetos en la hoja Dim obj As Object CheckExists = False On Error Resume Next For Each obj In ActiveSheet.Shapes If UCase(obj.name) = UCase(argName) Then CheckExists = True: Exit Function Next obj Set obj = Nothing End Function Sub DeleteObjects(shType As Single) ' Limpiar hoja 'Tipos: objeto 3D:30 , formulas: 17. Dim sh As Object On Error Resume Next For Each sh In ActiveSheet.Shapes If sh.Type = shType Then sh.Delete End If Next sh Set sh = Nothing End Sub ' 2022 A Becerra. ScienSolar.com Sub ExecuteAllRotations(rotationType As String) ' Encuentra las coordenadas INICIO Dim fila As Range Dim m As Integer, n As Integer Dim i As Integer Set fila = Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. To restore all default values, delete the CONFIG sheet and then press the New Sheet button.", vbExclamation Exit Sub End If If fila Is Nothing Then Exit Sub m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing ' Maneja cada tipo de rotacin Select Case rotationType Case "XZY" ActiveSheet.Cells(m + 1, n + 5) = 0 ActiveSheet.Cells(m + 2, n + 5) = 15 ActiveSheet.Cells(m + 3, n + 5) = 15 Rotate Case "YZ" ActiveSheet.Cells(m + 1, n + 5) = 0 ActiveSheet.Cells(m + 2, n + 5) = 0 ActiveSheet.Cells(m + 3, n + 5) = 0 Rotate Case "XZ" ActiveSheet.Cells(m + 1, n + 5) = 0 ActiveSheet.Cells(m + 2, n + 5) = 0 ActiveSheet.Cells(m + 3, n + 5) = 90 DoEvents Rotate Case "XY" ActiveSheet.Cells(m + 1, n + 5) = 0 ActiveSheet.Cells(m + 2, n + 5) = 90 ActiveSheet.Cells(m + 3, n + 5) = 0 Rotate Case "A" Application.Cursor = xlNorthwestArrow For i = 1 To ActiveSheet.Cells(m - 2, n + 4).Value Application.ScreenUpdating = True ActiveSheet.Cells(m + 1, n + 5).Value = _ ActiveSheet.Cells(m + 1, n + 5).Value + ActiveSheet.Cells(m - 2, n + 3).Value Rotate DoEvents Next i Application.Cursor = xlDefault Case "B" Application.Cursor = xlNorthwestArrow For i = 1 To ActiveSheet.Cells(m - 2, n + 4).Value Application.ScreenUpdating = True ActiveSheet.Cells(m + 2, n + 5).Value = _ ActiveSheet.Cells(m + 2, n + 5).Value + ActiveSheet.Cells(m - 2, n + 3).Value Rotate DoEvents Next i Application.Cursor = xlDefault Case "C" Application.Cursor = xlNorthwestArrow For i = 1 To ActiveSheet.Cells(m - 2, n + 4).Value ActiveSheet.Cells(m + 3, n + 5).Value = _ ActiveSheet.Cells(m + 3, n + 5).Value + ActiveSheet.Cells(m - 2, n + 3).Value Rotate DoEvents Next i Application.Cursor = xlDefault Case "n" Application.Cursor = xlNorthwestArrow On Error GoTo RotationError For i = 1 To ActiveSheet.Cells(m + 1, n + 7).Value ActiveSheet.Cells(m + 2, n + 7).Value = _ ActiveSheet.Cells(m + 2, n + 7).Value + ActiveSheet.Cells(m, n + 7).Value Rotate DoEvents Next i Case "Single" Application.Cursor = xlNorthwestArrow ActiveSheet.Cells(m + 2, n + 7).Value = _ ActiveSheet.Cells(m + 2, n + 7).Value + ActiveSheet.Cells(m, n + 7).Value Rotate Application.Cursor = xlDefault Case "SingleBack" Application.Cursor = xlNorthwestArrow ActiveSheet.Cells(m + 2, n + 7).Value = _ ActiveSheet.Cells(m + 2, n + 7).Value - ActiveSheet.Cells(m, n + 7).Value Rotate Application.Cursor = xlDefault End Select DoEvents Exit Sub RotationError: Application.Cursor = xlDefault End Sub ' Procedimientos originales manteniendo compatibilidad con los botones Sub rotate_XZY() ExecuteAllRotations "XZY" End Sub Sub rotate_YZ() ExecuteAllRotations "YZ" End Sub Sub rotate_XZ() ExecuteAllRotations "XZ" End Sub Sub rotate_XY() ExecuteAllRotations "XY" End Sub Sub rotate_A() ExecuteAllRotations "A" End Sub Sub rotate_B() ExecuteAllRotations "B" End Sub Sub rotate_C() ExecuteAllRotations "C" End Sub Sub rotate_n() ExecuteAllRotations "n" End Sub Sub rotate_Single() ExecuteAllRotations "Single" End Sub Sub rotate_SingleBack() ExecuteAllRotations "SingleBack" End Sub Sub ChangeParameter() ' 2022 A Becerra. ScienSolar.com Application.Cursor = xlNorthwestArrow Dim fila As Range Dim m As Integer Dim n As Integer Dim PASO As Single Dim i_f As Integer Set fila = Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing If Application.Caller = "ChangeParBack" Then PASO = -Cells(m, n + 7).Value Else PASO = Cells(m, n + 7).Value End If If PASO = 0.25 Then MsgBox "The value 0,25 is special and makes that the two adjacent cells to the left also change their value." End If i_f = Cells(m + 1, n + 7).Value For i = 1 To i_f Application.ScreenUpdating = True ActiveCell.Value = ActiveCell.Value + PASO If PASO = 0.25 Then ActiveCell.Offset(0, -1).Value = ActiveCell.Offset(0, -1).Value + PASO ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(0, -2).Value + PASO End If Rotate DoEvents Next i Set fila = Nothing Application.Cursor = xlDefault End Sub Sub DeleteData() Sheets("CONFIG").Columns("U:V").ClearContents End Sub Sub DeleteGraphFunction() ' Reset parameters to make a graph Dim steps Dim m1 As Integer Dim n1 As Integer steps = ActiveSheet.Buttons(Application.Caller).TopLeftCell.Offset(-1, 0).Address DeleteData Sheets("CONFIG").Range("T5").Value = ActiveSheet.Range(steps) ActiveSheet.Range(steps).Offset(2, 1).Value = 1 ' borra las gr_ficas ya dibujadas - historia = 1 ActiveSheet.Range(steps).Offset(1, 1).Value = "" ActiveSheet.Range(steps).Offset(1, 0).Value = "" ActiveSheet.Range(steps).Offset(1, -1).Value = "" ActiveSheet.DropDowns("List2").Select With Selection ' actualizar la lista para incluir los vectores posteriores Do While .ListCount > 0 ' incluye los vectores depu_s del actual .ListIndex = .ListCount .RemoveItem (.ListIndex) Loop i = 3 m1 = 3 n1 = 2 Do While Cells(m1 + i, n1 - 1) <> "" ' incluye todos los vectores anteriores al mdulo de gr?fico .AddItem Cells(m1 + i, n1 - 1).Value i = i + 9 Loop Sheets("CONFIG").Range("V6").Value = "" Range(steps).Select End With End Sub Sub ShowHideVecConf() Application.ScreenUpdating = False Dim r As Range Dim last As Single Dim ButtCol As Integer Dim TblColQty As Integer Dim TargetVecAddress As String TblColQty = 9 ButtCol = ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column TargetVecAddress = Range(ActiveSheet.Shapes(Application.Caller).TopLeftCell.Address).Offset(1, 0).Value ' put the target vector addres -in form A6 - in the cell below the button If Left(TargetVecAddress, 1) <> "A" And ButtCol = 1 Then Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell ' for A column buttons Else If Left(TargetVecAddress, 1) <> "A" Then TargetVecAddress = "A6" ' for buttons with other location ActiveSheet.Buttons(Application.Caller).TopLeftCell.Value = 1 Set r = ActiveSheet.Range(TargetVecAddress) End If 'Clean table If Cells(r.Row + 7, r.Column + 1).Value > 0 And Cells(r.Row + 8, r.Column + 1).Value > 0 Then 'verify if data exists If Cells(r.Row + 8, r.Column + 1).Value > 35 Then TblColQty = 18 If Cells(Cells(r.Row + 7, r.Column + 1).Value, Cells(r.Row + 8, r.Column + 1).Value).Value <> "" Then i = 1 Do While Cells(Cells(r.Row + 7, r.Column + 1).Value + i, Cells(r.Row + 8, r.Column + 1).Value).Value <> "" i = i + 1 Loop End If Range(Cells(Cells(r.Row + 7, r.Column + 1).Value - 4, Cells(r.Row + 8, r.Column + 1).Value), Cells(Cells(r.Row + 7, r.Column + 1).Value + i, Cells(r.Row + 8, r.Column + 1).Value + TblColQty)).Select Selection.ClearContents Cells(Cells(r.Row + 7, r.Column + 1).Value - 1, Cells(r.Row + 8, r.Column + 1).Value).Select If ButtCol > 3 Then ActiveSheet.Buttons(Application.Caller).TopLeftCell.Value = 1 ' Set this value under the button for additional radio buttons (optional) End If GoTo final End If If ButtCol > 1 Then GoTo final ' avoid changing button label 'End of clean table If Cells(r.Row, r.Column).Value = 1 And Cells(r.Row - 1, r.Column).Value <> "" Then last = Cells(r.Row - 1, r.Column).Value Else last = 1 End If i = 1 Do While i < last * 9 If Range(Cells(r.Row + i, r.Column), Cells(r.Row + i, r.Column)).Value = 1 Then Range(Cells(r.Row + i, r.Column), Cells(r.Row + i + 7, r.Column)).EntireRow.Hidden = True ActiveSheet.Buttons(Application.Caller).Caption = ChrW(9779) Range(Cells(r.Row + i, r.Column), Cells(r.Row + i, r.Column)).Value = 0 Else Range(Cells(r.Row + i, r.Column), Cells(r.Row + i + 7, r.Column)).EntireRow.Hidden = False ActiveSheet.Buttons(Application.Caller).Caption = ChrW(9650) Range(Cells(r.Row + i, r.Column), Cells(r.Row + i, r.Column)).Value = 1 End If i = i + 9 Loop Rotate final: Set r = Nothing Application.ScreenUpdating = True End Sub Sub ShowHideMenu() Application.ScreenUpdating = False Dim r As Range Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell If Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Value = 1 Then Range(Cells(r.Row, r.Column - 9), Cells(r.Row, r.Column - 5)).EntireColumn.Hidden = True ActiveSheet.Buttons(Application.Caller).Caption = ChrW(9654) Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Value = 0 Cells(3, 5).Value = Cells(3, 5).Value - 325 Else Range(Cells(r.Row, r.Column - 9), Cells(r.Row, r.Column - 5)).EntireColumn.Hidden = False ActiveSheet.Buttons(Application.Caller).Caption = ChrW(9664) Range(Cells(r.Row, r.Column), Cells(r.Row, r.Column)).Value = 1 Cells(3, 5).Value = Cells(3, 5).Value + 325 End If Rotate Set r = Nothing Application.ScreenUpdating = True End Sub Sub VectorForm() Dim r As Range Set r = ActiveSheet.Buttons(Application.Caller).TopLeftCell If Cells(r.Row + 7, r.Column + 2).Value = 1 Then 'Cells(r.Row + 8, r.Column + 2).Value = 2 Cells(r.Row + 7, r.Column + 2).Value = 2 Cells(r.Row, r.Column).Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorDark1 .TintAndShade = -0.249977111117893 .PatternTintAndShade = 0 End With Else If Cells(r.Row + 7, r.Column + 2).Value > 1 Then 'Cells(r.Row + 8, r.Column + 2).Value = 1 Cells(r.Row + 7, r.Column + 2).Value = 1 Cells(r.Row + 2, r.Column).Value = 10000 Cells(r.Row, r.Column).Select With Selection.Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .ThemeColor = xlThemeColorAccent6 .TintAndShade = 0.799981688894314 .PatternTintAndShade = 0 End With End If End If Set r = Nothing Rotate Rotate End Sub Sub Reset() ' 2022 A Becerra. ScienSolar.com Dim fila As Range Dim m As Integer Dim n As Integer Dim PASO As Single Dim i_f As Integer Set fila = Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing ActiveSheet.Cells(m + 2, n + 7).Value = Sheets("CONFIG").Cells(5, 9) ' Rotate End Sub Sub rotate_End() ' 2022 A Becerra. ScienSolar.com Dim fila As Range Dim m As Integer Dim n As Integer Dim PASO As Single Dim i_f As Integer Set fila = Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing ActiveSheet.Cells(m + 2, n + 7).Value = ActiveSheet.Cells(m, n + 7).Value * ActiveSheet.Cells(m + 1, n + 7).Value Set fila = Nothing Rotate End Sub Sub CreateCode() ' Generar cdigo para nuevos proyectos. ' 2022 A Becerra. ScienSolar.com 'Updated 27.08.2025 'Segment CreateCode-01. Define variables Dim fila As Range, m As Integer, n As Integer, m1 As Integer, n1 As Integer, f As Integer, k As Integer, max As Integer, subProj As Integer Dim flag As Boolean, FileName As Variant, Author As Variant, FileName1 As Variant, cellValue As String, Flename As String, TxtLine As String Dim oFile Dim lista As Range Dim MaxVecAllowed As Integer Dim ProjNum As Integer Dim LastProj As Integer Dim validInput As Boolean Dim FieldScanPresent As Boolean Dim FieldScanRow As Integer Dim userInput As String Dim ws As Worksheet, rng As Range, shp As Shape, oleObj As OLEObject, cbValues As Variant ' variables to identify shapes in the spreadsheet FieldScanPresent = False max = 1 subProj = 0 flag = False Set fila = ActiveSheet.Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column If Cells(m, n + 8).Value = "" Then Author = InputBox("Please, enter the name of the author of this model:", "Author name", "Your name" & Hour(Now) & Minute(Now)) & " (" & Date & ")" Cells(m, n + 8).Value = Author Else Author = Cells(m, n + 8).Value End If m1 = m n1 = n f = m + 3 Set fila = Nothing 'Segment CreateCode-01a. Define language. Set lista = Sheets("CONFIG").Cells.Find(What:="(LENGUAJE)", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If lista Is Nothing Then MsgBox "'(LENGUAJE)' was not found in the CONFIG sheet. To restore all default values, delete the CONFIG sheet and then press the New Sheet button.", vbExclamation Exit Sub End If m2 = lista.Row n2 = lista.Offset(0, -1).Column Lang = "_" & WorksheetFunction.VLookup(ActiveSheet.Cells(m - 1, n + 18).Value, Sheets("CONFIG").Range(Cells(m2, n2).Address(0, 0) & ":" & Cells(m2 + 14, n2 + 2).Address(0, 0)), 3, False) Set lista = Sheets("CONFIG").Cells.Find(What:="(LISTA)", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If lista Is Nothing Then MsgBox "'(LISTA)' was not found in the CONFIG sheet. To restore all default values, delete the CONFIG sheet and then press the New Sheet button.", vbExclamation Exit Sub End If m2 = lista.Row n2 = lista.Column Set lista = Nothing i = 2 Do While Sheets("CONFIG").Cells(m2 + i, n2) <> "" i = i + 1 Loop If ActiveSheet.Cells(m + 1, n - 1).Value <> "" And ActiveSheet.Cells(m + 1, n - 1).Value > 1 Then On Error Resume Next FileName = WorksheetFunction.VLookup(ActiveSheet.Cells(m + 1, n - 1).Value, Sheets("CONFIG").Range(Cells(m2 + 1, n2 + 1).Address(0, 0) & ":" & Cells(m2 + 70, n2 + 9).Address(0, 0)), Cells(m - 1, n + 18).Value + 2, False) Else FileName = "NewProyect" & Hour(Now) & Minute(Now) End If 'Segment CreateCode 02. Verify if FielScanner exists. Feb 2026 Dim existingControl As Object Dim existingControl2 As Object On Error Resume Next ' Set existingControl = ActiveSheet.DropDowns("RES_ViewType") Set existingControl2 = ActiveSheet.Buttons("RES_CUST2") On Error GoTo 0 If Not existingControl Is Nothing And Not existingControl2 Is Nothing Then FieldScanRow = Range("U11").Value ClearExistingControls FieldScanPresent = True userInput = " Note: The field scanner control panel will be introduced into the code with its own procedures and default parameters." End If 'Segment CreateCode-02a. Define the file name. FileName = InputBox("A text file containing the " & Lang & " language project code will be generated." & _ Chr(13) & userInput & _ Chr(13) & "Please enter the filename:", _ "Export Project Code", _ Cells(m + 1, n - 1).Value & "_" & FileName & Lang) FileName1 = FileName If FileName = Empty Then On Error Resume Next GoTo salida End If 'Segment CreateCode-02a. Define Lightness. validInput = False Do While Not validInput userInput = InputBox("Please select project complexity level:" & _ Chr(13) & Chr(13) & " - Normal/Light projects: Enter 20" & _ Chr(13) & " - Heavy projects (abundant data/vectors): Enter 7 or lower" & _ Chr(13) & Chr(13) & "Note: If you encounter a 'Procedure too large' error during project loading, re-export the project using a smaller value." & _ Chr(13) & Chr(13) & "Recommendation: Before deleting the current sheet, load the modified project into a new sheet to identify any export errors.", _ "Project Complexity Setting", 20) ' Check if user clicked Cancel or closed the dialog If userInput = "" Then Exit Sub ' or handle cancellation appropriately End If ' Validate if input is an integer If IsNumeric(userInput) Then If InStr(userInput, ".") = 0 And InStr(userInput, ",") = 0 Then MaxVecAllowed = Abs(CInt(userInput)) validInput = True Else MsgBox "Please enter a whole number (integer) without decimals.", vbExclamation, "Invalid Input" End If Else MsgBox "Please enter a valid numeric value.", vbExclamation, "Invalid Input" End If Loop 'Segment CreateCode-02a. Define the number of the project. validInput = False If Cells(m + 1, n - 1).Value < 2 Then Cells(m + 1, n - 1).Value = i Do While Not validInput userInput = InputBox("Please select an option:" & _ Chr(13) & " - To replace the current project: type " & Cells(m + 1, n - 1).Value & _ Chr(13) & " - To export a new project: type " & i & _ Chr(13) & " - To replace another project: type the project number" & _ Chr(13) & Chr(13) & "Note: The entered number will appear in the code header: 'Sub Project_...'" & _ Chr(13) & "All options require copying and pasting the exported code.", _ "Project Number", Cells(m + 1, n - 1).Value) ' Check if user clicked Cancel or closed the dialog If userInput = "" Then Exit Sub ' or handle cancellation appropriately End If ' Validate if input is an integer If IsNumeric(userInput) Then If InStr(userInput, ".") = 0 And InStr(userInput, ",") = 0 Then i = Abs(CInt(userInput)) validInput = True Else MsgBox "Please enter a whole number (integer) without decimals.", vbExclamation, "Invalid Input" End If Else MsgBox "Please enter a valid numeric value.", vbExclamation, "Invalid Input" End If Loop 'Segment CreateCode-02. Identify the las vector in the spreadsheet k = 0 ' Do While Cells(f, n - 1).Value <> "" k = k + 1 f = f + 9 Loop 'Segment CreateCode-03. Set the name of the output file for Mac and Windows FileName = FileName1 #If Mac Then filePath = ThisWorkbook.Path & "/" & FileName & ".txt" #Else filePath = ThisWorkbook.Path & "\" & FileName & ".txt" #End If oFile = FreeFile On Error GoTo salida If Error = 55 Then Close #oFile End If Open filePath For Output As #oFile ProjNum = i split: If k > MaxVecAllowed Then max = 1 End If 'Segment CreateCode-04. Generate Sub and Header Instructions to export the project. If k > MaxVecAllowed Then Print #oFile, "Sub Project_" & ProjNum & "_" & subProj + 1 & Lang & "(ByVal VecType, m, n, m1, n1 As Integer) ' " & FileName Else Print #oFile, "Sub Project_" & ProjNum & Lang & "(ByVal VecType, m, n, m1, n1 As Integer) ' " & FileName End If Print #oFile, "" Print #oFile, "' Updated: " & Date Print #oFile, "' Created by: " & Author Print #oFile, "' Modified by: _________________" Print #oFile, "' This file contains the code for your new ScienSolar project." Print #oFile, "' ==============================================================================" Print #oFile, "' PROJECT CODE: " & i Print #oFile, "' " Print #oFile, "' INTEGRATION INSTRUCTIONS:" Print #oFile, "' Note 1: The project number (" & ProjNum & ") in the function name must match the entry in the CONFIG sheet project list. Update if necessary." Print #oFile, "' Note 2: This code will be integrated into the main VBA project to automate project loading and execution." Print #oFile, "' Note 3: Generated formulas and values are limited to the first 30 columns. Keep all project data within this range for optimal performance." Print #oFile, "' " Print #oFile, "' STEP-BY-STEP INTEGRATION: ==================" Print #oFile, "' 1. CONFIG Sheet Setup (for new projects):" Print #oFile, "' - Navigate to the CONFIG sheet and add a consecutive number to the last row of the projects list (column C, from row 35)" Print #oFile, "' - Add a descriptive project name in the corresponding language column" Print #oFile, "' - Replace (if it doesn't match) the number in Sub Project_48 with the new number from the list" Print #oFile, "' 2. Numbering Validation:" Print #oFile, "' - Ensure projects in the CONFIG sheet maintain ascending numerical order" Print #oFile, "' - Only integers are allowed" Print #oFile, "' 3. VBA Editor Preparation:" Print #oFile, "' - Open VBA Editor (Alt+F11 Windows / Fn+Option+F11 macOS)" Print #oFile, "' - Close other workbooks to avoid accidental code placement" Print #oFile, "' - In the Project Explorer, select an existing module with available space" Print #oFile, "' - Alternatively, insert a new module (Insert -- > Module)" Print #oFile, "' 5. Code Implementation:" Print #oFile, "' - Select all code in this file and copy it" Print #oFile, "' - Paste at the end of the selected module's code (for new projects)" Print #oFile, "' - Replace de old code with the new one (for existing projects). Verify the code" Print #oFile, "' 6. Project Testing:" Print #oFile, "' - Return to the CONFIG sheet and click 'New Sheet'" Print #oFile, "' - Select your project from the list and click '+Vector'" Print #oFile, "' - Large projects require repeated '+Vector' button presses when loading. " Print #oFile, "' - Verify successful loading in the new sheet" Print #oFile, "' SUPPORT AND UPDATES: =====================" Print #oFile, "' Visit www.sciensolar.com for latest updates and documentation" Print #oFile, "' ScienSolar - Advanced Solar Project Management" Print #oFile, "' ==============================================================================" Print #oFile, "'" 'Segment CreateCode-05. Record dashboard values (only for the first file, in case of multiple files. When the project is too large, multiple files will be generated.) If m < 9 Then Print #oFile, " Cells(m1 -1, n1 + 2).FormulaR1C1 =" & """" & Cells(m - 1, n + 2).FormulaR1C1 + 1 & """" 'grabar el fondo de la hoja Print #oFile, " Cells(m1 - 1, n1 ).Value = " & """" & Cells(m - 1, n).Value & """" ' imprimir ENTIRE si existe For i = 0 To 3 ' Rows in the dashboard For j = 0 To 8 ' numero de columnas del tablero If Cells(m1 + i, n1 + j).FormulaR1C1 <> "" Then ' Scan all cells and save the formulas within them cellValue = ConvertToChrWCode(Cells(m1 + i, n1 + j).FormulaR1C1) 'reemplaza una comilla por dos comillas para que el codigo generado quede sin errores. Print #oFile, " Cells(m1 + " & i & ", n1 + " & j & ").FormulaR1C1 =" & """" & cellValue & """" End If Next j Next i Print #oFile, " Cells(m1, n1 + 9).FormulaR1C1 = " & """" & Cells(m, n + 9).FormulaR1C1 & """" ' Insert HELP comment If Not Cells(m, n + 9).Comment Is Nothing Then Dim Comm As String Comm = Cells(m, n + 9).Comment.text Comm = Replace(Comm, " ", "", 1) Comm = ConvertToChrWCode(Comm) Print #oFile, " Dim HELPtxt as String" Print #oFile, " HELPtxt = """ & Comm & """" Print #oFile, " On Error Resume Next " ' Ignore error 91 in older versions of Excel Print #oFile, " Cells(m1 , n1 + 9).Comment.Text Text:= HELPtxt" End If End If 'Segment CreateCode-06. Verify presence of shapes (combobox, buttons,spinbuttons, radiobutt) and export them the output code Set ws = ActiveSheet If m = 3 Then Set rng = ws.Range(Cells(m + 4, 4), Cells(m + 2 + MaxVecAllowed * 9, 30)) Else Set rng = ws.Range(Cells(m + 3, 4), Cells(m + 2 + MaxVecAllowed * 9, 30)) End If Print #oFile, "" Print #oFile, " ' Cdigo para recrear controles" Print #oFile, " Dim ws As Worksheet" Print #oFile, " Dim PatronW As Double ' The width of a cell that will be taken as measure patron for form objects" Print #oFile, " Dim PatronH As Double ' The height of a cell that will be taken as measure patron for form objects" Print #oFile, " Set ws = ThisWorkbook.ActiveSheet" Print #oFile, "" Print #oFile, " If m = " & m & " Then" Print #oFile, " PatronW = ActiveSheet.Cells(1, 1).Width" Print #oFile, " PatronH = ActiveSheet.Cells(1, 1).Height" Print #oFile, "" ' === FORM CONTROLS === For Each shp In ws.Shapes If Not Intersect(shp.TopLeftCell, rng) Is Nothing Then If shp.Type = msoFormControl Then Select Case shp.FormControlType Case xlButtonControl Print #oFile, " ' Button" Print #oFile, " ws.Buttons.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ").Select" Print #oFile, " With Selection" Print #oFile, " .name = """ & shp.name & """" Print #oFile, " .OnAction = """ & GetOnlyMacroName(shp.OnAction) & """" Print #oFile, " .Text = """ & ConvertToChrWCode(ActiveSheet.Shapes.Range(Array(shp.name)).TextFrame.Characters.text) & """" Print #oFile, " End With" Print #oFile, "" Case xlDropDown Print #oFile, " ' ComboBox" Print #oFile, " Set dd = ws.DropDowns.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " With dd" Print #oFile, " .Placement = " & shp.Placement Print #oFile, " .name = """ & shp.name & """" Print #oFile, " .LinkedCell = """ & ActiveSheet.DropDowns(shp.name).LinkedCell & """" cbValues = shp.ControlFormat.List For i = 1 To UBound(cbValues) Print #oFile, " .AddItem """ & ConvertToChrWCode(cbValues(i)) & """" Next i Print #oFile, " .ListFillRange = """ & ActiveSheet.DropDowns(shp.name).ListFillRange & """" Print #oFile, " .value = " & ActiveSheet.DropDowns(shp.name).Value Print #oFile, " .Display3DShading = " & ActiveSheet.DropDowns(shp.name).Display3DShading Print #oFile, " End With" Print #oFile, " Set dd = Nothing" Print #oFile, "" Case xlListBox Print #oFile, " ' ListBox" Print #oFile, " Set lb = ws.ListBoxes.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " With lb" Print #oFile, " .name = """ & shp.name & """" Print #oFile, " .LinkedCell = """ & ActiveSheet.ListBoxes(shp.name).LinkedCell & """" cbValues = shp.ControlFormat.List For i = 1 To UBound(cbValues) Print #oFile, " .AddItem """ & ConvertToChrWCode(cbValues(i)) & """" Next i Print #oFile, " .ListFillRange = """ & ActiveSheet.ListBoxes(shp.name).ListFillRange & """" Print #oFile, " .value = " & ActiveSheet.ListBoxes(shp.name).Value Print #oFile, " End With" Print #oFile, " Set lb = Nothing" Print #oFile, "" Case xlCheckBox Print #oFile, " ' CheckBox" Print #oFile, " Set chk = ws.CheckBoxes.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " chk.Caption = """ & ActiveSheet.Shapes.Range(Array(shp.name)).TextFrame.Characters.text & """" Print #oFile, " chk.name = """ & shp.name & """" Print #oFile, " chk.LinkedCell = """ & ActiveSheet.CheckBoxes(shp.name).LinkedCell & """" Print #oFile, " chk.value = " & ActiveSheet.CheckBoxes(shp.name).Value Print #oFile, " Set chk = Nothing" Print #oFile, "" Case xlOptionButton Print #oFile, " ' Opton button" Print #oFile, " Set opt = ws.OptionButtons.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " opt.Caption = """ & ActiveSheet.Shapes.Range(Array(shp.name)).TextFrame.Characters.text & """" Print #oFile, " With opt" Print #oFile, " .name = """ & shp.name & """" Print #oFile, " .LinkedCell = """ & ActiveSheet.OptionButtons(shp.name).LinkedCell & """" Print #oFile, " End With" Print #oFile, " Set opt = Nothing" Print #oFile, "" Case xlSpinner Print #oFile, " ' SpinButton" Print #oFile, " set spin = ws.Spinners.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " spin.name = """ & shp.name & """" Print #oFile, " spin.LinkedCell = """ & ActiveSheet.Spinners(shp.name).LinkedCell & """" Print #oFile, " spin.Min = " & ActiveSheet.Spinners(shp.name).Min Print #oFile, " spin.Max = " & ActiveSheet.Spinners(shp.name).max Print #oFile, " spin.Value = " & ActiveSheet.Spinners(shp.name).Value Print #oFile, " spin.SmallChange = " & ActiveSheet.Spinners(shp.name).SmallChange Print #oFile, " spin.value = " & ActiveSheet.Spinners(shp.name).Value Print #oFile, " spin.OnAction = """ & GetOnlyMacroName(shp.OnAction) & """" Print #oFile, " Set spin = Nothing" Print #oFile, "" Case xlScrollBar Print #oFile, " ' Scrollbar" Print #oFile, " set scrl = ws.ScrollBars.Add(Left:=Range(""" & _ shp.TopLeftCell.Address(0, 0) & """).Left + Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round((shp.Left - shp.TopLeftCell.Left) / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Top:=Range(""" & _ shp.TopLeftCell.Address & """).Top, Width:=Range(""" & _ shp.TopLeftCell.Address & """).Width * " & Replace(Round(shp.width / shp.TopLeftCell.width * 2, 0) / 2, ",", ".") & ", Height:=Range(""" & _ shp.TopLeftCell.Address & """).Height * " & Replace(Round(shp.height / shp.TopLeftCell.height * 2, 0) / 2, ",", ".") & ")" Print #oFile, " scrl.LinkedCell = """ & ActiveSheet.ScrollBars(shp.name).LinkedCell & """" Print #oFile, " scrl.name = """ & shp.name & """" Print #oFile, " scrl.LinkedCell = """ & ActiveSheet.Spinners(shp.name).LinkedCell & """" Print #oFile, " scrl.Min = " & ActiveSheet.ScrollBars(shp.name).Min Print #oFile, " scrl.Max = " & ActiveSheet.ScrollBars(shp.name).max Print #oFile, " scrl.Value = " & ActiveSheet.ScrollBars(shp.name).Value Print #oFile, " scrl.SmallChange = " & ActiveSheet.ScrollBars(shp.name).SmallChange Print #oFile, " scrl.LargeChange = " & ActiveSheet.ScrollBars(shp.name).LargeChange Print #oFile, " scrl.value = " & ActiveSheet.ScrollBars(shp.name).Value Print #oFile, " Set scrl = Nothing" Print #oFile, "" End Select End If End If Next shp ' === ACTIVEX (Only Windows) === #If Win64 Or Win32 Then For Each oleObj In ws.OLEObjects If Not Intersect(oleObj.TopLeftCell, rng) Is Nothing Then If TypeName(oleObj.Object) = "ComboBox" Then Print #oFile, " ' Cuadro combinado ActiveX" Print #oFile, " Set cbo = ws.OLEObjects.Add(ClassType:=""Forms.ComboBox.1"", Link:=False, DisplayAsIcon:=False, Left:=" & oleObj.Left & ", Top:=" & oleObj.Top & ", Width:=" & oleObj.width & ", Height:=" & oleObj.height & ")" Print #oFile, " With cbo.Object" For i = 0 To oleObj.Object.ListCount - 1 Print #oFile, " .AddItem """ & ConvertToChrWCode(cbValues(i)) & """" Next i Print #oFile, " .Value = """ & oleObj.Object.Value & """" Print #oFile, " End With" Print #oFile, "" End If End If Next oleObj #End If Print #oFile, " End If" Print #oFile, "" 'Segment CreateCode-07. In the case of multiple files, print the last file by calling the functions of the others. If (subProj + 1) * MaxVecAllowed * 9 + 8 > f Then ' For max = 1 To subProj Print #oFile, " Dim p as Integer" Print #oFile, " For p = 1 To " & subProj Print #oFile, " If Range(""A5"").Value = ""Next sub_i"" Then Exit Sub" Print #oFile, " Application.Run ""Project_" & ProjNum & "_"" & p & """ & Lang & """, VecType, m, n, m1, n1 ' " Print #oFile, " Next p " Print #oFile, "" max = 0 End If 'Segment CreateCode-08. Register vector data Do While Cells(m + 3, n - 1).Value <> "" ' cycle for each new project vector Print #oFile, " If m = m1 + " & m - 3 & " Then ' vector " & k If Cells(m + 4, n).Value = 186 Then 'If it is a graphic, call the project 15. Print #oFile, " Call Project_15(15, m, n, m1, n1)" End If 'Else If Cells(m + 6, n + 2).Value = "Delta =" Then ' If it is a derivative module, call project No. 2. Print #oFile, " Call Project_2(2, m, n, m1, n1)" End If For i = 3 To 11 ' Number of rows For j = -1 To 30 'Increase or decrease the number of columns to extract data from (2 = one additional column to the right) If Cells(m + i, n + j).FormulaR1C1 <> "" Then ' read all the cells of each vector and write its formula On Error Resume Next 'Replace special characters with their code cellValue = ConvertToChrWCode(Cells(m + i, n + j).FormulaR1C1) Print #oFile, " Cells(m + " & i & ", n + " & j & ").FormulaR1C1 =" & """" & cellValue & """" End If Next j Next i Print #oFile, " Cells(m + 3, n + 1).Interior.Color = " & """" & Cells(m + 3, n + 1).DisplayFormat.Interior.Color & """" ' color del vector Print #oFile, " Cells(m + 3, n + 1).Font.Size = " & """" & Cells(m + 3, n + 1).Font.Size & """" ' color del vector. 03 2024 Print #oFile, " Cells(m + 3, n + 1).Font.name = " & """" & Cells(m + 3, n + 1).Font.name & """" ' color del vector. 03 2024 Print #oFile, " Cells(m + 4, n - 1).Value = 1 " ' Expand menu Print #oFile, " Cells(m1 + 1, n1 + 1).Value = " & """" & Cells(m + 12, n).Value & """" ' Name to the next vector 'Segment CreateCode-09. Go to next vector m = m + 9 If Cells(m + 3, n - 1).Value = "" Then Print #oFile, " Cells(m1 + 2, n1 - 1).Value = " & (m - 3) / 9 ' cantidad de vectores para expandir el menu Else If max = MaxVecAllowed Then Print #oFile, " Range(""A5"").Value = ""Next sub_i"" " Print #oFile, " MsgBox ""Please press [+Vector] again to continue."" & vbNewLine & _" Print #oFile, " ""Large project detected."" & vbNewLine & vbNewLine & _" Print #oFile, " ""Remaining magnitudes: "" & " & k - 1 & ", _" Print #oFile, " vbInformation, ""Project Status""" Else Print #oFile, " Call AddNewVector " End If End If k = k - 1 ' count how many vectors remain to be added Print #oFile, " end if ' vector ends" 'Segment CreateCode-10. Finish the vector cycle max = max + 1 ' Control the maximum number of vectors per file. If max = MaxVecAllowed + 1 Then Exit Do Loop 'Segment CreateCode-11. Configure the module for paths if it is present. Print #oFile, " If m = m1 + " & m - 12 & " Then " flag = False i = 4 Do While Cells(m1 + i, n1 - 1) <> "" ' Verify if the module for path is present If Cells(m1 + i, n1).Value = 186 Then flag = True End If i = i + 9 Loop If flag = True Then ' Refresh vector list for the path module. Print #oFile, " ActiveSheet.DropDowns(""List2"").Select" Print #oFile, " With Selection ' " Print #oFile, " Do While .ListCount > 0 ' borrar lista" Print #oFile, " .ListIndex = .ListCount" Print #oFile, " .RemoveItem (.ListIndex)" Print #oFile, " Loop" Print #oFile, " i = 3" Print #oFile, " Do While Cells(m1 + i, n1 - 1) <> """" ' incluir todos los vectores a la lista" Print #oFile, " .AddItem Cells(m1 + i, n1 - 1).Value" Print #oFile, " i = i + 9" Print #oFile, " Loop" Print #oFile, " End With" Print #oFile, " Sheets(""CONFIG"").Range(""V6"").Value = """"" Print #oFile, " Cells(m1 + 9, n1 + 4).Select" Print #oFile, " Call DeleteGraphFunction" End If ' End of the path module Range("D50").Select 'Segment CreateCode-12. Write the update sheet command for the last file. If (subProj + 1) * MaxVecAllowed * 9 + 7 > f Then 'Segment CreateCode-11a. Additional code to include cells with information below the last vector (for example additional instructions text) For i = 3 To 100 ' Number of rows For j = -1 To 30 ' Increase or decrease the number of columns to extract data from (2 = one additional column to the right) If Cells(m + i, n + j).FormulaR1C1 <> "" Then ' Read all the cells of each vector and write its formula On Error Resume Next 'Replace special characters with their code cellValue = ConvertToChrWCode(Cells(m + i, n + j).FormulaR1C1) Print #oFile, " Cells(m + " & i + 9 & ", n + " & j & ").FormulaR1C1 =" & """" & cellValue & """" End If Next j Next i 'Execute complementary functions Print #oFile, " Call BlackWhiteDesk " ' Refresh background Print #oFile, " Call PutEqBut " 'Put buttons for equations in the spreadsheet 'Recreate the Field Scanner Control Panel if it is present. Added in Feb 2026 If FieldScanPresent = True Then Print #oFile, " Cells(" & FieldScanRow & ", 3).Select" Print #oFile, " Call PutFieldScannerControls " ' Place the command in the code Cells(FieldScanRow, 3).Select Call PutFieldScannerControls ' Place again the controls in the sheet End If End If 'Segment CreateCode-13. Finish Sub for each file Print #oFile, " end if ' actualizar hoja" Print #oFile, "End Sub" 'Segment CreateCode-14. If the number of rows counted is less than the total number of rows, repeat the cycle. subProj = subProj + 1 If (subProj) * MaxVecAllowed * 9 + 6 < f Then GoTo split Close #oFile ' MsgBox "The code file(s) have been successfully saved in:" & vbCrLf & filePath & vbCrLf & vbCrLf & _ "IMPORTANT NOTE:" & vbCrLf & _ " This export includes data only from the first 30 columns and the dashboard" & vbCrLf & _ " Any data stored outside this region will not be included in the export" & vbCrLf & _ " To integrate the project into ScienSolar, read the instructions in the code header.", _ vbInformation, "Export Completed" flag = True ' Export success flag salida: If flag = False Then ' If there was a problem with the code export MsgBox "The file was not exported. Check that the file name does not contain special characters such as accents or other illegal symbols.", vbCritical End If Set lista = Nothing Set fila = Nothing Set ws = Nothing Set rng = Nothing Set shp = Nothing Set oleObj = Nothing Set existingControl = Nothing Set existingControl2 = Nothing End Sub Sub BlackWhiteDesk() 'Function to change the sheet appearance ' 2022 A Becerra. ScienSolar.com Application.ScreenUpdating = False ' Variable definition Dim ws As Worksheet Dim i As Integer Dim fila As Range Dim m As Long, n As Long Set ws = ActiveSheet ' Segment BW-01. Variable definition Set fila = ws.Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If If fila Is Nothing Then Exit Sub m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column ' Get value of i (keeping the same logic as original) If IsNumeric(ws.Cells(m - 1, n + 2).Value) Then i = ws.Cells(m - 1, n + 2).Value Else i = 0 End If ' Original special logic If i > 2 Then i = 0 ' value 3 comes from project code and corresponds to zero If IsNumeric(i) = False Then i = 0 ' Apply formatting according to i value (keeping original order) If i = 2 Then ' Segment BW-02. Standard sheet appearance parameters (black background gray frame) ' Frame With ws.Range("N2:AE6,L3:M6,H6:K6,D7:AE347") .Interior.Pattern = xlSolid .Interior.ThemeColor = xlThemeColorDark1 .Interior.TintAndShade = -0.149998474074526 .Font.ThemeColor = xlThemeColorAccent1 .Font.TintAndShade = -0.249977111117893 End With ' Background With ws.Range("H9:T343") .Interior.ThemeColor = xlThemeColorLight1 .Font.ThemeColor = xlThemeColorDark1 End With ' Text With ws.Range("V9:AD343") .Interior.ThemeColor = xlThemeColorDark1 .Font.ThemeColor = xlThemeColorLight1 End With ' Header With ws.Range("H6:T8,V6:AD8") .Interior.Color = 255 .Font.ThemeColor = xlThemeColorDark1 .Font.name = "Calibri" .Font.Size = 16 .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom End With ' Columns F and G ws.Range("F7:F343").Font.ThemeColor = xlThemeColorLight1 ws.Range("G7:G343").Font.Color = -16776961 ' Axis color With ws.Range(ws.Cells(m + 1, n + 4), ws.Cells(m + 3, n + 4)) .Interior.ThemeColor = xlThemeColorDark1 End With ws.Cells(m, n + 4).Interior.ThemeColor = xlThemeColorAccent6 ws.Cells(m, n + 4).Interior.TintAndShade = -0.249977111117893 ws.Cells(m - 1, n + 2).Value = 1 End If If i = 0 Then ' Segment BW-03. Optional appearance parameters 1 (black background) ' Black background With ws.Range("D7:AE347") .Interior.ThemeColor = xlThemeColorLight1 .Font.ThemeColor = xlThemeColorDark1 End With With ws.Range("L2:AE6") .Interior.ThemeColor = xlThemeColorLight1 .Font.ThemeColor = xlThemeColorDark1 End With With ws.Range("H6:L6") .Interior.ThemeColor = xlThemeColorLight1 .Font.ThemeColor = xlThemeColorDark1 End With ' Axis color With ws.Range(ws.Cells(m, n + 4), ws.Cells(m + 3, n + 4)) .Interior.ThemeColor = xlThemeColorDark1 End With ws.Cells(m - 1, n + 2).Value = 2 End If If i = 1 Then ' Segment BW-04. Optional appearance parameters 2 (white background gray frame) ' Frame With ws.Range("N2:AE6,L3:M6,H6:K6,D7:AE347") .Interior.Pattern = xlSolid .Interior.ThemeColor = xlThemeColorDark1 .Interior.TintAndShade = -0.149998474074526 .Font.ThemeColor = xlThemeColorAccent1 .Font.TintAndShade = -0.249977111117893 End With ' Background With ws.Range("H9:T343") .Interior.ThemeColor = xlThemeColorDark1 .Font.ThemeColor = xlThemeColorLight1 End With ' Text With ws.Range("V8:AD343") .Interior.ThemeColor = xlThemeColorDark1 .Font.ThemeColor = xlThemeColorLight1 End With ' Header With ws.Range("H6:T8,V6:AD8") .Interior.Color = 255 .Font.ThemeColor = xlThemeColorDark1 .Font.name = "Calibri" .Font.Size = 16 .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom End With ' Columns F and G ws.Range("F7:F343").Font.ThemeColor = xlThemeColorLight1 ws.Range("G7:G343").Font.Color = -16776961 ' Axis color With ws.Range(ws.Cells(m, n + 4), ws.Cells(m + 3, n + 4)) .Interior.ThemeColor = xlThemeColorLight1 End With ws.Cells(m - 1, n + 2).Value = 0 End If ' Segment BW-04a. Format for left data column With ws.Range("D8:G8") .Interior.ThemeColor = xlThemeColorAccent6 .Interior.TintAndShade = -0.25 .Font.ThemeColor = xlThemeColorDark1 End With With ws.Range("G10:G343") .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="=LARGO(ESPACIOS(G10))>0" .FormatConditions(1).SetFirstPriority With .FormatConditions(1) .Font.ThemeColor = xlThemeColorDark1 .Interior.ThemeColor = xlThemeColorAccent6 .Interior.TintAndShade = -0.249946592608417 .StopIfTrue = False End With End With ' Segment BW-05. Sheet update Rotate Set fila = Nothing Application.ScreenUpdating = True ws.Range("G7").Select Set ws = Nothing End Sub Sub DataOutput(ByVal m, n As Integer) ' may 2023 Lx = ActiveSheet.Cells(m + 9, n - 1).Value Ly = ActiveSheet.Cells(m + 9, n).Value Lz = ActiveSheet.Cells(m + 9, n + 1).Value Lox = ActiveSheet.Cells(m + 7, n - 1).Value Loy = ActiveSheet.Cells(m + 7, n).Value Loz = ActiveSheet.Cells(m + 7, n + 1).Value ' Segment DataOutput01. Get sum of the coordinates of the field through all the points. 16.05.2025 ' If Application.WorksheetFunction.And(Cells(m + 4, n + 1).Value <> "", Cells(m + 10, n).Value < 0, Cells(m + 11, n).Value < 0) Then ' ActiveSheet.Cells(m + 6, n - 1).Value = ActiveSheet.Cells(m + 6, n - 1).Value + ActiveSheet.Cells(m + 9, n - 1).Value ' ActiveSheet.Cells(m + 6, n).Value = ActiveSheet.Cells(m + 6, n).Value + ActiveSheet.Cells(m + 9, n).Value ' ActiveSheet.Cells(m + 6, n + 1).Value = ActiveSheet.Cells(m + 6, n + 1).Value + ActiveSheet.Cells(m + 9, n + 1).Value ' Else ' Segment DataOutput02. Get table of the coordinates of the field through all the points. 16.05.2025 Cells(Cells(m + 10, n).Value - 4, Cells(m + 11, n).Value).Value = "To clean the table, press the right button in " & Cells(m + 3, n - 1).Address(rowabsolute = True, columnAbsolute = True) & ". " Cells(Cells(m + 10, n).Value - 3, Cells(m + 11, n).Value).Value = "To get more data, insert new formulas in " _ & Cells(m + 11, n + 2).Address(rowabsolute = True, columnAbsolute = True) _ & " and " & Cells(m + 11, n + 3).Address(rowabsolute = True, columnAbsolute = True) & ". " Cells(Cells(m + 10, n).Value - 2, Cells(m + 11, n).Value).Value = "To stop data output, set " _ & Cells(m + 10, n).Address(rowabsolute = True, columnAbsolute = True) & " = 0 and " _ & Cells(m + 11, n).Address(rowabsolute = True, columnAbsolute = True) & " = 0. " Cells(Cells(m + 10, n).Value, Cells(m + 11, n).Value).Value = "VECTOR " & Cells(m + 3, n).Value & " DATA" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value).Value = " Step" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 1).Value = " x" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 2).Value = " y" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 3).Value = " z" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 4).Value = " " & Cells(m + 3, n).Value & "x" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 5).Value = " " & Cells(m + 3, n).Value & "y" Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 6).Value = " " & Cells(m + 3, n).Value & "z" 'Agregar columna para la formula adicional: If Cells(m + 11, n + 2).Value <> "" Then Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 7).Value = " " & Cells(m + 11, n + 2).Address(rowabsolute = True, columnAbsolute = True) & " (...)" End If If Cells(m + 11, n + 3).Value <> "" Then Cells(Cells(m + 10, n).Value + 1, Cells(m + 11, n).Value + 8).Value = " " & Cells(m + 11, n + 3).Address(rowabsolute = True, columnAbsolute = True) & " (...)" End If Z = 0 'Identificar la ultima fila para ingresar datos. Do While Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value).Value <> "" Z = Z + 1 Loop Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value).Value = Z - 1 Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 1).Value = Lox Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 2).Value = Loy Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 3).Value = Loz Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 4).Value = Lx Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 5).Value = Ly Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 6).Value = Lz If Cells(m + 11, n + 2).Value <> "" Then 'datos de la primera celda adicional Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 7).Value = Cells(m + 11, n + 2).Value End If If Cells(m + 11, n + 3).Value <> "" Then 'datos de la segunda celda adicional Cells(Cells(m + 10, n).Value + Z, Cells(m + 11, n).Value + 8).Value = Cells(m + 11, n + 3).Value End If ' End If End Sub Sub ManualOnline() If Range("T2").Value = 2 Then ActiveWorkbook.FollowHyperlink Address:="https://www.amazon.com/dp/B0BR9GJLLY?ref_=pe_3052080_397514860""" Else ActiveWorkbook.FollowHyperlink Address:="https://www.amazon.com/-/es/PhD-Ariel-Rey-Becerra/dp/B0BTGH4BP8/ref=tmm_hrd_swatch_0?_encoding=UTF8&qid=&sr=" End If End Sub Sub PutEq() ' Copy equations from 3DModels sheet to activesheet Dim T_color Dim flag As Boolean T_color = Range("F3").Interior.Color Dim EqN As String Dim obj As Object EqN = ActiveSheet.Buttons(Application.Caller).Caption 'verificar si 3DModels existe flag = False Dim nombre As Variant nombre = "3DModels" For Each obj In ThisWorkbook.Sheets If nombre = obj.name Then flag = True End If Next obj If flag = False Then MsgBox "The spreadsheet named 3DModels that contains the object could not be found. Download the spreadsheet" _ & " from ScienSolar.com and move it into this book to show the object..", vbCritical GoTo salida End If 'Continuar si existe 3DModels If ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column = 29 Then ActiveSheet.Buttons(Application.Caller).TopLeftCell.Offset(-1, -5).Activate Else If EqN = "Info" Then ActiveSheet.Buttons(Application.Caller).TopLeftCell.Offset(1, 2).Activate Else ActiveSheet.Buttons(Application.Caller).TopLeftCell.Offset(0, 1).Activate End If End If If CheckExists(EqN) = False Then On Error Resume Next For Each obj In Sheets("3DModels").Shapes If UCase(obj.name) = UCase(EqN) Then Sheets("3DModels").Shapes(EqN).Copy ActiveSheet.Paste With ActiveSheet.Shapes(EqN) .TextFrame2.TextRange.Characters.Font.Fill.ForeColor.RGB = T_color .TextFrame2.TextRange.Characters.Font.Fill.Transparency = 0.2 End With End If Next obj ActiveCell.Offset(10, -1).Activate Else ActiveSheet.Shapes(EqN).Delete End If salida: Set obj = Nothing End Sub Sub PutEqBut() ' Put equations buttons in text zone Dim EqN As String For j = 4 To 30 For i = 9 To 343 On Error Resume Next If Left(Cells(i, j).Value, 3) = "(Eq" Then Cells(i, j).Select EqN = Cells(i, j).Value ActiveSheet.Buttons.Add(ActiveCell.Left, ActiveCell.Top + 15, 55, 15).Select Selection.OnAction = "PutEq" Selection.Characters.text = EqN With Selection.Characters(Start:=1, Length:=3).Font .name = "Calibri" .FontStyle = "Normal" .Size = 12 End With End If Next i Next j Range("G7").Select End Sub Sub AddObject() ' Add/remove new objects to projects (composed of one or more vectors). Updated 07.2025 Application.ScreenUpdating = False Dim fila As Range Dim m, n, i, BeginRow, EndRow, lastRow, RowQty, ObjQty As Integer Dim flag As Boolean flag = False Set fila = ActiveSheet.Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing If IsNumeric(Cells(2, 2).Value) = True And Cells(2, 2).Value <> "" Then ObjQty = Cells(2, 2).Value Else ObjQty = 1 End If 'Segment AddObject-00. Verify if application caller is an auxiliar button (a button of a specific project) Dim Len1 As Integer Dim Len2 As Integer Dim EntireRefRow As Integer Dim EntireFinRow As Integer Dim RelativeRow As Integer Len1 = InStr(ActiveSheet.Shapes(Application.Caller).name, ")") - InStr(ActiveSheet.Shapes(Application.Caller).name, "(") - 1 Len2 = InStr(ActiveSheet.Shapes(Application.Caller).name, "]") - InStr(ActiveSheet.Shapes(Application.Caller).name, "[") - 1 On Error Resume Next EntireRefRow = Mid(ActiveSheet.Shapes(Application.Caller).name, 9, Len1) EntireFinRow = Mid(ActiveSheet.Shapes(Application.Caller).name, 11 + Len1, Len2) If EntireRefRow > 1 And EntireFinRow > 1 Then flag = True ' Yes, it is an auxiliar button End If 'Segment AddObject-01. Configure initial parameters in the spreadsheet 'Duplicate ENTIRE object (an ENTIRE object can be a line while a normal object can be a dL, a piece of the line) If Left(Application.Caller, 6) = "ENTIRE" Then Dim TempObj As String If Range("B2").Value = "ENTIRE" Then TempObj = Range("C3").Value Range("B2").Value = "1" Range("C3").Value = Range("C2").Value Range("C2").Value = TempObj ActiveSheet.Buttons("ENTIRE").text = Sheets("CONFIG").Range("K2").Value Else Range("B2").Value = "ENTIRE" If Range("C2").Value = "" Then Range("C2").Value = Range("C3").Value Do While Cells(m + 3 + 9 * i, n - 1).Value <> "" i = i + 1 Loop Range("C3").Value = i * 9 + 5 Else TempObj = Range("C2").Value Range("C2").Value = Range("C3").Value Range("C3").Value = TempObj End If ActiveSheet.Buttons("ENTIRE").text = "Num. OBJs." MsgBox "To clone an ENTIRE object, insert in B3 the row where the LARGE object begins and in C3 the row where it ends," _ & " then press +OBJ to clone the object and -OBJ to delete it." _ & " Each project has its own instructions for handling these buttons. Please read the instructions for the specific project." End If GoTo final End If 'Segment AddObject-02. Define range of rows depending on pressed button If Application.Caller = "NewVectorMinus" Then If Range("N5").Value < 1 Then MsgBox "With this button only new added vectors can be deleted. Use the -OBJ button to delete other vectors, indicating in cells B3 and C3 the range of rows in which the pattern is located, according to the instructions of the specific project." GoTo final End If BeginRow = 6 EndRow = 14 RowQty = EndRow - BeginRow + 1 Else If IsNumeric(Cells(3, 2).Value) = True And IsNumeric(Cells(3, 3).Value) = True Then BeginRow = Cells(3, 2).Value EndRow = Cells(3, 3).Value RowQty = EndRow - BeginRow + 1 RelativeRow = BeginRow - 15 Else MsgBox " The numbers of rows in " & Cells(3, 2).Address(0, 0) & " and " & Cells(3, 3).Address(0, 0) & " are incorrect." GoTo final End If End If 'Segment AddObject-03. Count the number of vectors in the spreadsheet and check the data i = 0 Do While Cells(m + 3 + 9 * i, n - 1).Value <> "" i = i + 1 Loop If BeginRow > 0 And EndRow > 0 Then ' Check the correctness of the present parameters data If i * 9 < 15 Or BeginRow < 6 Then ' verificar que no sea el primer vector. MsgBox "The object to be copied or deleted must be after row 14. The operation was not performed." GoTo final End If If EndRow - BeginRow < 0 Then ' verificar que los numeros ingresados sean correctos MsgBox "The last row is smaller than the first. The operation was not performed." GoTo final End If If Int((EndRow - BeginRow + 1) / 9) <> (EndRow - BeginRow + 1) / 9 Then MsgBox "The number of rows indicated is not correct and does not correspond to a complete object. " _ & "Verify that the first indicated row (" & BeginRow & ") begins in a vector and the last one (" & EndRow _ & ") corresponds to the last row of the same or another vector. The operation was not performed." Rows(BeginRow & ":" & EndRow).Select GoTo final End If 'Segment AddObject-04. Duplicate an ENTIRE object (example: an entire line in the project Distribution of charges) If Cells(2, 2).Value = "ENTIRE" Then If Left(Application.Caller, 7) = "AddButt" Then ' adding an object Dim MainSheet As String Dim OldSheet As String MainSheet = ActiveSheet.name ActiveSheet.Copy After:=Sheets(MainSheet) OldSheet = ActiveSheet.name ActiveSheet.Range("A" & BeginRow & ":H" & EndRow).Select Selection.Cut Sheets(MainSheet).Select ActiveSheet.Paste Destination:=ActiveSheet.Cells(m + 3 + 9 * i, 1) Columns("A:H").Select Selection.Replace What:="'" & OldSheet & "'!", replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Sheets(OldSheet).Select Application.DisplayAlerts = False ActiveWindow.SelectedSheets.Delete Application.DisplayAlerts = True Sheets(MainSheet).Select Cells(m + 3 + 9 * i, 1).FormulaR1C1 = "=R[-9]C+1" ' Approx. default position of the duplicated object (atom): Cells(m + 7 + 9 * i, 7).Value = Cells(m + 7 + 9 * i, 7).Value + Cells(m + 12 + 9 * i, 7).Value + _ Cells(m + 12 + 9 * i, 7).Value * Cells(m + 3 + 9 * i, 1) / 100 * Cells(m + 4 + 9 * i, 7) Range("H9").Select 'Segment AddObject-05. Correct the COUNTIF formulas that were altered during the cutting and pasting process, convert $D$xx:$D$xx to D:D Dim celda As Range Dim hoja As Worksheet Dim formulaOriginal As String Dim formulaModificada As String Dim posIni As Long, posFin As Long Dim secondtime As Boolean Set hoja = ActiveSheet For Each celda In hoja.UsedRange If celda.HasFormula Then formulaOriginal = celda.Formula ' Find COUNTIF( If InStr(1, formulaOriginal, "COUNTIF(D$", vbTextCompare) > 0 Then ' Find Dxx:Dyy posIni = InStr(1, formulaOriginal, "COUNTIF(D$", vbTextCompare) If posIni > 0 Then ' Search where range ends (el punto y coma despus del rango) posFin = InStr(posIni, formulaOriginal, ",") If posFin > posIni Then ' Replace with D:D Dim parteAntes As String, parteDespues As String parteAntes = Left(formulaOriginal, posIni + 7) ' hasta "CONTAR.SI(" parteDespues = Mid(formulaOriginal, posFin) formulaModificada = parteAntes & "D:D" & parteDespues celda.Formula = formulaModificada End If End If End If End If Next celda Else ' Deleting a big object (atom) If flag = True Then ' if it is an auxiliar button If BeginRow < 16 Then MsgBox "You are at the LOWER LIMIT ALLOWED! Objects will not be deleted. Please reduce the number of objects to be deleted or modify the range." Else ActiveSheet.Shapes("Elements" & EntireRefRow).Delete Range("A" & EntireRefRow & ":H" & EntireFinRow).Select Selection.Delete Shift:=xlUp Cells(m + 5, n - 1).Value = 5000 If Range("A" & EntireRefRow).Value <> "" Then Range("A" & EntireRefRow).FormulaR1C1 = "=R[-9]C+1" End If End If Else ' If it is a conventional button +Obj or -Obj If Cells(m + 1 + 9 * i, 1).Row - RowQty * ObjQty < BeginRow Then MsgBox "When performing this operation, the objects that are before the row that was established as a minimum are deleted, therefore THIS ACTION WILL NOT BE EXECUTED. Please modify the number of objects or the rows range." Else Range("A" & Cells(m + 3 + 9 * i, 1).Row - RowQty * ObjQty & ":G" & Cells(m + 3 + 9 * i, 1).Row).Select Selection.Delete Shift:=xlUp Cells(m + 5, n - 1).Value = 5000 End If End If End If 'Segment AddObject-06. Duplicate small objects (example: an element of charge dL in the Charge Distribution project) Else If Left(Application.Caller, 7) = "AddButt" Then ' adding small objects (electrons) If flag = True Then ' if it is an auxiliar button i = (EntireFinRow - m - 2) / 9 ' number of vectors of the given big object End If Do While ObjQty > 0 ' add parts to the given big object If flag = True Then ' if an auxiliar button is pressed Rows(m + 3 + 9 * i & ":" & m + 2 + 9 * i + RowQty).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Range("A" & EntireRefRow + RelativeRow & ":E" & EntireRefRow + RelativeRow + RowQty - 1).Copy Cells(m + 3 + 9 * i, 1).Select ActiveSheet.Paste Else Range("A" & BeginRow & ":E" & EndRow).Copy Rows(m + 3 + 9 * i & ":" & m + 3 + 9 * i).Insert Shift:=xlDown End If m = m + RowQty ObjQty = ObjQty - 1 If ObjQty = 0 And Cells(m + 3 + 9 * i, 1).Value <> "" Then Cells(m + 3 + 9 * i, 1).FormulaR1C1 = "=R[-9]C+1" 'Fix vector number End If Loop Application.CutCopyMode = False Else ' Deleting objects If Cells(m + 1 + 9 * i, 1).Row - RowQty * ObjQty < BeginRow Then MsgBox "You are at the LOWER LIMIT ALLOWED! Objects will not be deleted. Please reduce the number of objects to be deleted or modify the range." Else If flag = True Then ' if an auxiliar button is pressed If ObjQty > 0 Then Rows(EntireFinRow - RowQty * ObjQty + 1 & ":" & EntireFinRow).Select Selection.Delete Shift:=xlUp Else Rotate Exit Sub End If If Range("A" & EntireFinRow - RowQty * ObjQty + 1).Value <> "" Then Range("A" & EntireFinRow - RowQty * ObjQty + 1).FormulaR1C1 = "=R[-9]C+1" 'Fix vector number End If Cells(m + 5, n - 1).Value = 5000 Else Range("A" & Cells(m + 3 + 9 * i, 1).Row - RowQty * ObjQty & ":E" & Cells(m + 3 + 9 * i, 1).Row).Select Selection.Delete Shift:=xlUp Cells(m + 5, n - 1).Value = 5000 End If If Application.Caller = "NewVectorMinus" Then Range("N5").Value = Range("N5").Value - 1 End If End If End If End If End If 'Range("G7").Select Rotate final: Set fila = Nothing Set celda = Nothing Set hoja = Nothing Application.ScreenUpdating = True End Sub Sub AutoScale() ' Added 20-06-2024 to v 1.5 'Module to configure scale according to the max value of the vector positions or coordinates (7 variants) Dim a As Variant Dim B As Variant Dim c As Variant Dim fila As Range Dim m As Integer Dim n As Integer a = Array() Set fila = Cells.Find(What:="INICIO", _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=True) If fila Is Nothing Then MsgBox "'INICIO' was not found in the active sheet. Reset this value (in uppercase) in cell A2 or restart the work on a new sheet.", vbExclamation Exit Sub End If m = fila.Offset(1, 0).Row n = fila.Offset(1, 1).Column Set fila = Nothing InitValues = 0 i = 0 j = 0 B = Cells(m + 2, n + 3).Value On Error GoTo msg ''Scale according to the max of the positions Do While ActiveSheet.Cells(m + 3 + i * 9, n - 1).Value <> "" If Cells(m + 5 + i * 9, n + 1).Value < 1 Then ReDim Preserve a(j + 5) a(j) = Abs(Cells(m + 7 + i * 9, n - 1).Value) a(j + 1) = Abs(Cells(m + 7 + i * 9, n).Value) a(j + 2) = Abs(Cells(m + 7 + i * 9, n + 1).Value) End If i = i + 1 j = j + 3 Loop c = Cells(m + 3, n + 3).Value / WorksheetFunction.max(a) 'Choose between seven different scales (Coord has two options) If B = c Then c = c / 2 GoTo Pos Else If B = c / 2 Then GoTo Coord Else GoTo Pos End If End If 'Scale according to the max of the coordinates Coord: i = 0 j = 0 '//////////// 'Find the maximum value and reduce it with 60*0.1*magnitude of the vector Dim maxVal As Double Dim maxI As Integer, maxJ As Integer maxVal = 0 maxI = 0 maxJ = 0 'First option. Find the max value and put in its vector 60*1*.. Do While ActiveSheet.Cells(m + 3 + i * 9, n - 1).Value <> "" If Cells(m + 4 + i * 9, n).Value = 183 Then If Cells(m + 5 + i * 9, n + 1).Value < 1 Then ReDim Preserve a(j + 5) ' Use loop for all 3 positions For k = 0 To 2 a(j + k) = Abs(Cells(m + 9 + i * 9, n - 1 + k).Value) If a(j + k) > maxVal Then maxVal = a(j + k) maxI = i maxJ = j + k End If Next k End If End If i = i + 1 j = j + 3 Loop If Left(Cells(m + 5 + maxI * 9, n).Value, 2) < 15 Then Cells(m + 5 + maxI * 9, n).Value = 6 & Cells(m + 5 + maxI * 9, n).Value & "*" & _ 0.1 * WorksheetFunction.max(Abs(Cells(m + 9 + maxI * 9, n - 1).Value), Abs(Cells(m + 9 + maxI * 9, n).Value), Abs(Cells(m + 9 + maxI * 9, n + 1).Value)) GoTo Pos End If 'Second option. Put in all the vectors 60*1*.. i = 0 j = 0 Do While ActiveSheet.Cells(m + 3 + i * 9, n - 1).Value <> "" If Cells(m + 4 + i * 9, n).Value = 183 Then If Cells(m + 5 + i * 9, n + 1).Value < 1 Then If Left(Cells(m + 5 + i * 9, n).Value, 2) < 15 Then Cells(m + 5 + i * 9, n).Value = 6 & Cells(m + 5 + i * 9, n).Value & "*" & _ 0.1 * WorksheetFunction.max(Abs(Cells(m + 9 + i * 9, n - 1).Value), Abs(Cells(m + 9 + i * 9, n).Value), Abs(Cells(m + 9 + i * 9, n + 1).Value)) Else Cells(m + 5 + i * 9, n).Value = Mid(Cells(m + 5 + i * 9, n).Value, 2, 1) ' Recover the initial value of the cell End If End If End If i = i + 1 j = j + 3 Loop Pos: If IsNumeric(c) Then Cells(m + 2, n + 3).Value = c i = 0 Else msg: MsgBox "The scale could not be modified because there is no data." End If Set fila = Nothing Rotate End Sub Sub RenameSheet() 'Rename the spreadsheet Dim ws As Worksheet Dim lb As Object Dim seleccionado As String Dim index As Integer On Error Resume Next Set ws = ActiveSheet ' Set lb = ws.Shapes("List1").ControlFormat index = lb.Value ' Verify if there is selection If index > 2 And index <> 15 Then seleccionado = Replace(lb.List(index), "'", "", 1, -1) On Error Resume Next ws.name = seleccionado End If Set ws = Nothing Set lb = Nothing End Sub Sub SplitTextInTheory() ' This macro divides the theory text and distributes it throughout zone 7 Dim texto As String Dim longitudTexto As Long Dim segmento As String Dim i As Long, j As Long Dim celdaInicio As Range Dim posicionEspacio As Long Dim RowLenght As Integer Dim rangoPermitido As Range Set rangoPermitido = ActiveSheet.Range("V10:AD340") ' Checks if the selected cell is outside the allowed range If Not Intersect(ActiveCell, rangoPermitido) Is Nothing Then Else MsgBox "The selected cell is outside the allowed range (columns V-AD and rows 10-340). Insert the text into a cell in column W, select the cell, and press the button again.", vbExclamation, "Cell out of range" Exit Sub End If RowLenght = (ActiveSheet.Range("AD10").Column - ActiveCell.Column) * 14 'Defines the text and the cell in which it starts Set celdaInicio = ActiveCell texto = ActiveCell.Value If texto = "" Then MsgBox "There is no text in cell " & ActiveCell.Address(0, 0) & ".", vbExclamation Exit Sub End If ' Calculate the length of the text longitudTexto = Len(texto) ' Initialize variables i = 1 j = 0 ' Scroll through text in segments of up to 100 characters Do While i <= longitudTexto ' Extract a segment of 100 characters segmento = Mid(texto, i, RowLenght) ' Find the last space within the segment posicionEspacio = InStrRev(segmento, " ") ' If a space is found, adjust the segment to avoid breaking words. If posicionEspacio > 0 Then segmento = Left(segmento, posicionEspacio - 1) End If ' Save the segment in the corresponding cell celdaInicio.Offset(j, 0).Value = Trim(segmento) ' Advance to the next segment i = i + Len(segmento) + 1 j = j + 1 Loop MsgBox "The text in cell " & ActiveCell.Address(0, 0) & " has been split and saved into cells.", vbInformation End Sub Function GetOnlyMacroName(onActionStr As String) As String Dim exclamationPos As Long ' If it doesn't have "!", it's a local macro (it only returns the name) exclamationPos = InStrRev(onActionStr, "!") If exclamationPos > 0 Then GetOnlyMacroName = Mid(onActionStr, exclamationPos + 1) Else GetOnlyMacroName = onActionStr End If ' Remove extra quotes if there are any GetOnlyMacroName = Replace(GetOnlyMacroName, "'", "") End Function Function ConvertToChrWCode(text As Variant) As String Dim i As Long Dim char As String Dim charCode As Long Dim result As Variant Dim LineLen As Long Dim LineMax As Long LineLen = 1 LineMax = 100 result = "" For i = 1 To Len(text) char = Mid(text, i, 1) charCode = AscW(char) ' Si es un carcter ASCII estndar (excepto comillas), lo dejamos tal cual If charCode >= 32 And charCode <= 126 And char <> """" Then result = result & char LineLen = LineLen + 1 Else ' Si es una comilla, la escapamos (duplicamos) If char = """" Then result = result & """""" ' Si la linea es muy larga ElseIf charCode = 10 Or charCode = 13 Then If LineLen > LineMax Then result = result & """" & " & Chr(10) & _ " & vbNewLine & """ " LineLen = 0 Else result = result & """" & " & Chr(10) & """ LineLen = LineLen + 1 End If Else If result <> "" And Right(result, 1) <> """" Then result = result & """ & " End If result = result & "ChrW(" & charCode & ")" If i < Len(text) Then result = result & " & """ End If End If End If Next i ' Aseguramos que no queden fragmentos sueltos como " & " al final If Right(result, 3) = " & " Then result = Left(result, Len(result) - 3) End If If Left(result, 5) = "ChrW(" Then result = """& " & result End If Dim NumChar As Long NumChar = InStrRev(result, "ChrW(") '- InStrRev(result, "ChrW(") If NumChar <> 0 And Len(result) - NumChar < 12 Then result = result & " & """ End If result = Replace(result, " ""ChrW", " ChrW") result = Replace(result, """ChrW(", """"" & ChrW(") ConvertToChrWCode = result End Function Sub SetResolution() 'Control panel for cells C7, C16, etc. (Field mode). Feb.2026 'Segment SetResolution-01. Set variables and initial values Dim x_ini As Double, x_fin As Double, y_ini As Double, y_fin As Double, z_ini As Double, z_fin As Double Dim r_ini As Double, r_fin As Double, phi_ini As Double, phi_fin As Double, theta_ini As Double, theta_fin As Double Dim x_res As Variant, y_res As Variant, z_res As Variant, r_res As Variant, phi_res As Variant, theta_res As Variant Dim xS As Double, ButStep As Double, FieldGrad As Double, ButtSign As Single, targetRow As Single targetRow = Range("U11"): xS = Range("E5"): Range("Z10") = 1 With ActiveSheet x_ini = .Range("Y12"): x_fin = .Range("Z12"): y_ini = .Range("Y13"): y_fin = .Range("Z13"): z_ini = .Range("Y14"): z_fin = .Range("Z14") r_ini = .Range("Y15"): r_fin = .Range("Z15"): phi_ini = .Range("Y16"): phi_fin = .Range("Z16"): theta_ini = .Range("Y17"): theta_fin = .Range("Z17") End With ButStep = Range("U12"): FieldGrad = Range("AC15"): ButtSign = IIf(Application.Caller Like "RES_S[1357]", -1, 1) 'Segment SetResolution-02. Set parameters depending on pressed button of the control panel Dim btn As Button: On Error Resume Next: Set btn = ActiveSheet.Buttons("RES_S9"): On Error GoTo 0 Select Case Application.Caller Case "RES_S2", "RES_S1" ' Change defined area x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20 If x_ini = x_fin And Range("AB19") = 2 Then y_ini = y_ini - ButStep * ButtSign: y_fin = y_fin + ButStep * ButtSign: z_ini = z_ini - ButStep * ButtSign: z_fin = z_fin + ButStep * ButtSign ElseIf y_ini = y_fin And Range("AB19") = 2 Then x_ini = x_ini - ButStep * ButtSign: x_fin = x_fin + ButStep * ButtSign: z_ini = z_ini - ButStep * ButtSign: z_fin = z_fin + ButStep * ButtSign ElseIf z_ini = z_fin And Range("AB19") = 2 Then x_ini = x_ini - ButStep * ButtSign: x_fin = x_fin + ButStep * ButtSign: y_ini = y_ini - ButStep * ButtSign: y_fin = y_fin + ButStep * ButtSign ElseIf r_ini = r_fin Then: r_ini = r_ini + ButStep * ButtSign: r_fin = r_fin + ButStep * ButtSign ElseIf phi_ini = phi_fin Then: phi_ini = phi_ini + ButStep * ButtSign * 10: phi_fin = phi_fin + ButStep * ButtSign * 10 ElseIf theta_ini = theta_fin Then: theta_ini = theta_ini + ButStep * ButtSign * 10: theta_fin = theta_fin + ButStep * ButtSign * 10 Else: x_ini = 0: x_fin = 0: y_ini = -200 / xS: y_fin = 200 / xS: z_ini = -200 / xS: z_fin = 200 / xS: r_ini = 100 / xS: r_fin = 100 / xS: phi_ini = 0: phi_fin = 360: theta_ini = 0: theta_fin = 90 End If ' Move the defined area Case "RES_S3", "RES_S4": x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20: Range("AC12") = Range("AC12") + ButStep * ButtSign Case "RES_S5", "RES_S6": x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20: Range("AC13") = Range("AC13") + ButStep * ButtSign Case "RES_S7", "RES_S8": x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20: Range("AC14") = Range("AC14") + ButStep * ButtSign Case "RES_S9": x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20: Range("AC12") = 0: Range("AC13") = 0: Range("AC14") = 0 Case "RES_M": x_res = 10 / xS: y_res = 10 / xS: z_res = 10 / xS: r_res = 10 / xS: phi_res = 10: theta_res = 10 Case "RES_L": x_res = 5 / xS: y_res = 5 / xS: z_res = 5 / xS: r_res = 5 / xS: phi_res = 5: theta_res = 5 Case "RES_XL": x_res = 3 / xS: y_res = 3 / xS: z_res = 3 / xS: r_res = 3 / xS: phi_res = 3: theta_res = 3 ' Change the color number (color view) in 3 modes Case "RES_CUST1" FieldGrad = Switch(FieldGrad = 0, 10, FieldGrad = 10, (Range("P6") + Range("R6")) / 2, True, 0) Range("AC15").FormulaR1C1 = "=" & Str(FieldGrad) & "/R[-5]C[-3]": Reset: Exit Sub ' Change the coordinate system for field display Case "RES_CUST2" Set btn = ActiveSheet.Buttons(Application.Caller): On Error GoTo 0 If Not btn Is Nothing Then With Range("AB19") Select Case btn.text Case "YZ": .Value = 2: btn.text = "XZ": x_ini = y_ini: x_fin = y_fin: y_ini = 0: y_fin = 0 Case "XZ": .Value = 2: btn.text = "XY": y_ini = x_ini: y_fin = x_fin: z_ini = 0: z_fin = 0 Case "XY": .Value = 5: btn.text = "Spherical": r_ini = 100 / xS: r_fin = 100 / xS: phi_ini = 0: phi_fin = 360: theta_ini = 0: theta_fin = 180 Case "Spherical": .Value = 3: btn.text = "Fibonacci": r_ini = 100 / xS: r_fin = 100 / xS: phi_ini = 0: phi_fin = 360 Case "Fibonacci": .Value = 4: btn.text = "Cylindrical": r_ini = 100 / xS: r_fin = 100 / xS: phi_ini = 0: phi_fin = 360: z_ini = -100 / xS: z_fin = 100 / xS Case "Cylindrical": .Value = 1: btn.text = "P(x,y,z)": Cells(targetRow + 4, 1).FormulaR1C1 = "=R12C29": Cells(targetRow + 4, 2).FormulaR1C1 = "=R13C29": Cells(targetRow + 4, 3).FormulaR1C1 = "=R14C29": x_ini = 0: x_fin = 0: z_ini = y_ini: z_fin = y_fin Case "P(x,y,z)": .Value = 2: btn.text = "YZ": x_ini = 0: x_fin = 0: z_ini = y_ini: z_fin = y_fin Case Else: btn.text = "YZ" End Select End With End If x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20 'PRO level: Case "RES_Bar" On Error Resume Next Set btn = ActiveSheet.Buttons(Application.Caller) On Error GoTo 0 If Not btn Is Nothing Then With Range("U31") ' Ciclo 1,2,3,1... .Value = (.Value Mod 3) + 1 Select Case .Value Case 1: btn.text = "Bar: " & ChrW(10003) & ChrW(8681) Case 2: btn.text = "Bar: " & ChrW(10003) & ChrW(8679) Case 3: btn.text = "Bar: " & ChrW(10008) End Select End With End If x_res = 30 / xS: y_res = 30 / xS: z_res = 30 / xS: r_res = 30 / xS: phi_res = 20: theta_res = 20 End Select 'Refresh origin info Set btn = ActiveSheet.Buttons("RES_S9"): On Error GoTo 0 btn.text = "(" & Range("AC12") & "," & Range("AC13") & "," & Range("AC14") & ")" 'Segment SetResolution-03. Apply values to the cells of the field configuration. With ActiveSheet .Range("Y12").Value = "=" & Str(x_ini) & "*R[-2]C[1]": .Range("Z12").Value = "=" & Str(x_fin) & "*R[-2]C": .Range("AA12").Value = "=" & Str(x_res) & "*R[-2]C[-1]" .Range("Y13").Value = "=" & Str(y_ini) & "*R[-3]C[1]": .Range("Z13").Value = "=" & Str(y_fin) & "*R[-3]C": .Range("AA13").Value = "=" & Str(y_res) & "*R[-3]C[-1]" .Range("Y14").Value = "=" & Str(z_ini) & "*R[-4]C[1]": .Range("Z14").Value = "=" & Str(z_fin) & "*R[-4]C": .Range("AA14").Value = "=" & Str(z_res) & "*R[-4]C[-1]" .Range("Y15").Value = "=" & Str(r_ini) & "*R[-5]C[1]": .Range("Z15").Value = "=" & Str(r_fin) & "*R[-5]C": .Range("AA15").Value = "=" & Str(r_res) & "*R[-5]C[-1]" .Range("Y16").Value = "=" & Str(phi_ini): .Range("Z16").Value = "=" & Str(phi_fin): .Range("AA16").Value = "=" & Str(phi_res) .Range("Y17").Value = "=" & Str(theta_ini): .Range("Z17").Value = "=" & Str(theta_fin): .Range("AA17").Value = "=" & Str(theta_res) End With Set btn = Nothing Rotate End Sub Sub CreateFieldModeControlPanel() ' Create Control panel for cells C7, C16, etc. (Field mode).Feb.2026 Application.ScreenUpdating = False 'Segment CreateFieldModeControlPanel-01. Check if the control panel already exists (using the combo box) If FieldScannerControlPermission() = False Then Exit Sub 'Segment CreateFieldModeControlPanel-02. Put Controls and configure the cell values for the field view Call PutFieldScannerControls Application.ScreenUpdating = True MsgBox "Field scanning control panel successfully created.", vbInformation, "Operation completed" End Sub Function FieldScannerControlPermission() As Boolean 'Verify that all conditions for installing the control panel are met 'Segment FieldScannerControlPermission-01. Check if the control panel already exists (using the combo box and main button) FieldScannerControlPermission = True Dim existingControl As Object Dim existingControl2 As Object On Error Resume Next ' Set existingControl = ActiveSheet.DropDowns("RES_ViewType") Set existingControl2 = ActiveSheet.Buttons("RES_CUST2") On Error GoTo 0 If Not existingControl Is Nothing And Not existingControl2 Is Nothing Then Dim respuestaExistente As VbMsgBoxResult respuestaExistente = MsgBox("The control panel already exists." & vbCrLf & _ "Do you want to recreate it? (This will delete the existing panel)", _ vbYesNo + vbQuestion + vbDefaultButton2, "Panel already exists") If respuestaExistente <> vbYes Then MsgBox "Operation cancelled. The existing panel remains.", vbInformation, "Cancelado" FieldScannerControlPermission = False Exit Function End If ' Clear existin controls if the user wants. Call ClearExistingControls FieldScannerControlPermission = True End If 'Segment FieldScannerControlPermission-02. Check the selected cell Dim rowNumber As Long rowNumber = ActiveCell.Row ' Check if the selected cell is in column C and meets the conditions If ActiveCell.Column <> 3 Or ((rowNumber - 7) Mod 9) <> 0 Then MsgBox "The active cell must be in column C and in a row that matches C7, C16, C25, etc. Field mode is activated only in one of these cells." & vbCrLf & _ "Current active cell: " & ActiveCell.Address(0, 0) & vbCrLf & _ "Please select a valid cell.", _ vbExclamation, "Incorrect active cell" FieldScannerControlPermission = False Exit Function End If 'Segment FieldScannerControlPermission-03. 'Confirmation message for deleting cells Dim zonas As Collection Dim zona As Range Dim celda As Range Dim zonaConTexto As Boolean Set zonas = New Collection ' Clear the zones zonas.Add Range("V9:AD9") ' Primera fila zonas.Add Range("W11:AD18") ' Bloque central zonas.Add Range("Z19:AD25") ' Bloque inferior ' Verify the presence of text in each area zonaConTexto = False For Each zona In zonas ' Verify each cell in each zone For Each celda In zona If Len(Trim(celda.Value)) > 0 Then zonaConTexto = True End If Next celda Next zona 'Confirmation of content removal If zonaConTexto = True Then Dim respuesta As VbMsgBoxResult respuesta = MsgBox("Do you want to delete the contents of cells " & vbCrLf & _ "V9:AD9, W11:AD18 and Z19:AD25 " & vbCrLf & _ "to place the field scan panel there?" & vbCrLf & _ "This action cannot be undone.", _ vbYesNo + vbQuestion + vbDefaultButton2, "Confirm deletion") If respuesta <> vbYes Then MsgBox "Operation cancelled by the user.", vbInformation, "Cancelado" FieldScannerControlPermission = False End If End If Set zonas = Nothing Set zona = Nothing Set celda = Nothing Set existingControl = Nothing Set existingControl2 = Nothing End Function Sub ClearExistingControls() 'Control panel for cells C7, C16, etc. (Field mode). Feb.2026 ' This subroutine removes the controls created by the macro ' Ignore errors if any control does not exist On Error Resume Next 'Segment ClearExistingControls-01. Reset field parameters to default Cells(Range("U11").Value + 4, 1).Value = Cells(Range("U11").Value + 4, 1).Value Cells(Range("U11").Value + 4, 2).Value = Cells(Range("U11").Value + 4, 2).Value Cells(Range("U11").Value + 4, 3).Value = Cells(Range("U11").Value + 4, 3).Value Cells(Range("U11").Value + 1, 2).Value = Cells(Range("U11").Value + 1, 2).Value 'Segment ClearExistingControls-23 Delete DropDown(ComboBox) Dim ws As Worksheet Set ws = ActiveSheet ws.DropDowns("ViewType").Delete Dim obj As Object Dim nombreObjeto As String For Each obj In ws.Shapes nombreObjeto = obj.name If UCase(Left(nombreObjeto, 4)) = "RES_" Then 'Field Scanner controls obj.Delete ElseIf Left(nombreObjeto, 8) = "ModLev1_" Then 'Level 1 controls obj.Delete End If Next obj On Error GoTo 0 'Segment ClearExistingControls-05. Also clean up any specific formulas that might indicate that the macro was executed. If ws.Range("L5").Value = 1 Then ' Call ClearColorBar ' Uncomment for PRO version With Range("V13:V24").Font .ColorIndex = xlAutomatic .TintAndShade = 0 End With End If Range("V9:AD9").ClearContents Range("W11:AD18").ClearContents Range("Z19:AD25").ClearContents Range("T9:U34").ClearContents 'Refresh Set ws = Nothing Rotate ' MsgBox "Existing controls removed.", vbInformation, "Controls removed" End Sub Sub PutFieldScannerControls() 'Segment PutFieldScannerControls-01. Configure the cell values for the field view Dim xS As Double Dim VersionLevel As Integer xS = Range("E5").Value VersionLevel = Range("L5").Value On Error Resume Next 'Segment PutFieldScannerControls-02. Clean area B9:AD25 Range("V9:AD9").ClearContents Range("W11:AD18").ClearContents Range("Z19:AD25").ClearContents 'Segment PutFieldScannerControls-03. Configure cells ActiveCell.FormulaR1C1 = _ "=IF(R19C28=1,"""",IF(R19C28=2,R21C27,IF(R19C28=3,R22C27,IF(R19C28=4,R23C27,IF(R19C28=5,R24C27,"""")))))" Range("AC12").FormulaR1C1 = Cells(ActiveCell.Row + 4, 1) Range("AC13").FormulaR1C1 = Cells(ActiveCell.Row + 4, 2) Range("AC14").FormulaR1C1 = Cells(ActiveCell.Row + 4, 3) Cells(ActiveCell.Row + 4, 1).FormulaR1C1 = "=R12C29" Cells(ActiveCell.Row + 4, 2).FormulaR1C1 = "=R13C29" Cells(ActiveCell.Row + 4, 3).FormulaR1C1 = "=R14C29" Range("U11").Value = ActiveCell.Row Range("Z10").Value = 1 Range("AB19").Value = 1 ' Selected distribution Cells(ActiveCell.Row + 1, 2).FormulaR1C1 = "=IF(R26C21<14,R26C21,R26C21 & ""*"" & R27C21)" Range("U10").FormulaR1C1 = "Surface:" Range("U12").NumberFormat = """Step: "" 0.0 " Range("U12").FormulaR1C1 = 20 / xS ' Default step for surface displacement Range("U13").FormulaR1C1 = "Preview:" Range("U16").FormulaR1C1 = "Origin:" Range("U21").FormulaR1C1 = "Resolution:" Range("U25").FormulaR1C1 = "Vec size reg:" Range("U28").FormulaR1C1 = "Custom:" Range("V9").FormulaR1C1 = _ "////////////////////////////////////////////////// CONFIGURACIN ///////////////////////////////////////////////" Range("V25").FormulaR1C1 = _ "//////////////////////////////////////////////////////////////////////////////////////////////////////////////////" Range("W11").FormulaR1C1 = "| FIELD VISUALIZATION PARAMETERS:" Range("W12").FormulaR1C1 = "| " Range("W13").FormulaR1C1 = "|" Range("W14").FormulaR1C1 = "|" Range("W15").FormulaR1C1 = "|" Range("W16").FormulaR1C1 = "|" Range("W17").FormulaR1C1 = "|" Range("W18").FormulaR1C1 = _ "|__________________________________________________________________________________" Range("X11").FormulaR1C1 = "" Range("X12").FormulaR1C1 = "=IF(R[7]C[4]=2,""[x" & ChrW(8321) & " , x" & ChrW(8322) & "] ="","""")" Range("X13").FormulaR1C1 = "=IF(R[6]C[4]=2,""[y" & ChrW(8321) & " , y" & ChrW(8322) & "] ="","""")" Range("X14").FormulaR1C1 = "=IF(OR(R[5]C[4]=2,R[5]C[4]=4),""[z" & ChrW(8321) & " , z" & ChrW(8322) & "] ="","""")" Range("X15").FormulaR1C1 = "=IF(R[4]C[4]=3,""[" & ChrW(-10187) & ChrW(-8653) & ", " & ChrW(-10187) & ChrW(-8653) & "] ="",IF(R[4]C[4]=4,""[" & ChrW(-10187) & ChrW(-8436) & ChrW(8321) & " , " & ChrW(-10187) & ChrW(-8436) & ChrW(8322) & "] ="",IF(R[4]C[4]=5,""[" & ChrW(-10187) & ChrW(-8653) & ChrW(8321) & " , " & ChrW(-10187) & ChrW(-8653) & ChrW(8322) & "] ="","""")))" Range("X16").FormulaR1C1 = "=IF(R[3]C[4]=3,""Puntos:"",IF(R[3]C[4]>3,""[" & ChrW(-10187) & ChrW(-8431) & ChrW(8321) & " , " & ChrW(-10187) & ChrW(-8431) & ChrW(8322) & "] ="",""""))" Range("X17").FormulaR1C1 = "=IF(R[2]C[4]=5,""[" & ChrW(952) & ChrW(8321) & " , " & ChrW(952) & ChrW(8322) & "] = "","""")" ' Range("Y10").FormulaR1C1 = " 1 =" ' Only for Periodic Table project Range("Y11").FormulaR1C1 = "" Range("Y12").FormulaR1C1 = "=" & Str(0 / xS) & "*R[-2]C[1]" Range("Y13").FormulaR1C1 = "=" & Str(-100 / xS) & "*R[-3]C[1]" Range("Y14").FormulaR1C1 = "=" & Str(-100 / xS) & "*R[-4]C[1]" Range("Y15").FormulaR1C1 = "= " & Str(100 / xS) & "*R[-5]C[1]" Range("Y16").FormulaR1C1 = "= " & Str(0 / xS) & "*R[-6]C[1]" Range("Y17").FormulaR1C1 = "= " & Str(0 / xS) & "*R[-7]C[1]" Range("Z12").FormulaR1C1 = "= " & Str(0 / xS) & "*R[-2]C" Range("Z13").FormulaR1C1 = "= " & Str(100 / xS) & "*R[-3]C" Range("Z14").FormulaR1C1 = "= " & Str(100 / xS) & "*R[-4]C" Range("Z15").FormulaR1C1 = "= " & Str(100 / xS) & "*R[-5]C" Range("Z16").FormulaR1C1 = "= 360*R[-6]C" Range("Z17").FormulaR1C1 = "= 180*R[-7]C" Range("AA11").FormulaR1C1 = " Step:" Range("AA12").FormulaR1C1 = "= " & Str(10 / xS) & "*R[-2]C[-1]" Range("AA13").FormulaR1C1 = "= " & Str(10 / xS) & "*R[-3]C[-1]" Range("AA14").FormulaR1C1 = "= " & Str(10 / xS) & "*R[-4]C[-1]" Range("AA15").FormulaR1C1 = "= " & Str(10 / xS) & "*R[-5]C[-1]" Range("AA16").FormulaR1C1 = "= 10" Range("AA17").FormulaR1C1 = "= 10" Range("AB11").FormulaR1C1 = "| Shift coordinates:" Range("AB12").FormulaR1C1 = "| in x:" Range("AB13").FormulaR1C1 = "| in y:" Range("AB14").FormulaR1C1 = "| in z:" Range("AB15").FormulaR1C1 = "| Color:" Range("AB16").FormulaR1C1 = "| " Range("AB17").FormulaR1C1 = "| " Range("AC15").FormulaR1C1 = "= 10/R[-5]C[-3]" Range("Z19").FormulaR1C1 = "|" Range("Z20").FormulaR1C1 = "|" Range("Z21").FormulaR1C1 = "|" Range("Z22").FormulaR1C1 = "|" Range("Z23").FormulaR1C1 = "|" Range("Z24").FormulaR1C1 = "|" Range("AA19").FormulaR1C1 = "Dist. surface:" Range("AA20").FormulaR1C1 = "" Range("AA21").FormulaR1C1 = _ "=""o[""&R[-9]C&""]x=[""&R[-9]C[-2]&"";""&R[-9]C[-1]&""]o2[""&R[-8]C&""]y=[""&R[-8]C[-2]&"";""&R[-8]C[-1]&""]o3[""&R[-7]C&""]z=[""&R[-7]C[-2]&"";""&R[-7]C[-1]&""]color=[""&R[-6]C[2]&""]origin[cart.]=[""&R[-9]C[2]&"";""&R[-8]C[2]&"";""&R[-7]C[2]&""]FieldLayers[0]FieldLayersRange=[1;10]LayerThickness=[1]tfactor=0,008s""" Range("AA22").FormulaR1C1 = _ "=""f[""&R[-7]C&""]r=[""&R[-7]C[-2]&"";""&R[-7]C[-1]&""]f2[""&R[-6]C&""]points=[""&R[-6]C[-2]&"";""&R[-6]C[-1]&""]f3[""&R[-5]C&""]theta=[""&R[-5]C[-2]&"";""&R[-5]C[-1]&""]color=[""&R[-7]C[2]&""]origin[cart.]=[""&R[-10]C[2]&"";""&R[-9]C[2]&"";""&R[-8]C[2]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Range("AA23").FormulaR1C1 = _ "=""c[""&R[-8]C&""]rho=[""&R[-8]C[-2]&"";""&R[-8]C[-1]&""]c2[""&R[-7]C&""]phi=[""&R[-7]C[-2]&"";""&R[-7]C[-1]&""]c3[""&R[-9]C&""]z=[""&R[-9]C[-2]&"";""&R[-9]C[-1]&""]color=[""&R[-8]C[2]&""]origin[cart.]=[""&R[-11]C[2]&"";""&R[-10]C[2]&"";""&R[-9]C[2]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Range("AA24").FormulaR1C1 = _ "=""s[""&R[-9]C&""]r=[""&R[-9]C[-2]&"";""&R[-9]C[-1]&""]s2[""&R[-8]C&""]phi=[""&R[-8]C[-2]&"";""&R[-8]C[-1]&""]s3[""&R[-7]C&""]theta=[""&R[-7]C[-2]&"";""&R[-7]C[-1]&""]color=[""&R[-9]C[2]&""]origin[cart.]=[""&R[-12]C[2]&"";""&R[-11]C[2]&"";""&R[-10]C[2]&""]FieldLayers[0]FieldLayersRange=[0;0]LayerThickness=[1]tfactor=0,008s""" Range("AB19").FormulaR1C1 = "1" Range("AB20").FormulaR1C1 = "1. At a point in space" Range("AB21").FormulaR1C1 = "2: In Cartesian distribution" Range("AB22").FormulaR1C1 = "3: In dist. Fibonacci (spherical)" Range("AB23").FormulaR1C1 = "4. In cylindrical distribution" Range("AB24").FormulaR1C1 = "5. In spherical distribution" 'Segment PutFieldScannerControls-04. Add buttons and controls Dim ws As Worksheet Set ws = ActiveSheet ' ComboBox With ws.DropDowns.Add(Left:=Range("L8").Left, Top:=Range("$L$8").Top, _ width:=Range("$L$8").width * 3.5, height:=Range("$L$8").height) .Placement = 2 .name = "RES_ViewType" .LinkedCell = "$AB$19" .ListFillRange = "$AB$20:$AB$24" .Value = 1 .Display3DShading = True End With ' Single buttons Dim btnSpecs As Variant If VersionLevel = 1 Then ' Pro Version 'Additional controls ' Call AdditionalControlsPro ' Uncomment for PRO version btnSpecs = Array( _ Array("O8", 0.5, 1.5, "RES_FieldButton", "Rotate", ChrW(8629) & " Field"), _ Array("U9", 0, 1, "RES_RESETBUTT", "CreateFieldModeControlPanel", "RESET"), _ Array("U11", 0, 1, "RES_CUST2", "SetResolution", "P(x,y,z)"), _ Array("U15", 0, 1, "RES_CUST1", "SetResolution", "Color"), _ Array("U20", 0, 1, "RES_S9", "SetResolution", "(0,0,0)"), _ Array("U22", 0, 1, "RES_M", "SetResolution", "Low"), _ Array("U23", 0, 1, "RES_L", "SetResolution", "SD"), _ Array("U24", 0, 1, "RES_XL", "SetResolution", "HD"), _ Array("U30", 0, 1, "RES_More", "MoreBarButtons", "More"), _ Array("U31", 0, 1, "RES_Bar", "SetResolution", "Bar: " & ChrW(10003) & ChrW(8681)) _ ) Else ' Normal Version btnSpecs = Array( _ Array("O8", 0.5, 1.5, "RES_FieldButton", "Rotate", ChrW(8629) & " Field"), _ Array("U9", 0, 1, "RES_RESETBUTT", "CreateFieldModeControlPanel", "RESET"), _ Array("U11", 0, 1, "RES_CUST2", "SetResolution", "P(x,y,z)"), _ Array("U15", 0, 1, "RES_CUST1", "SetResolution", "Color"), _ Array("U20", 0, 1, "RES_S9", "SetResolution", "(0,0,0)"), _ Array("U22", 0, 1, "RES_M", "SetResolution", "Low"), _ Array("U23", 0, 1, "RES_L", "SetResolution", "SD"), _ Array("U24", 0, 1, "RES_XL", "SetResolution", "HD") _ ) End If Dim spec As Variant, rng As Range For Each spec In btnSpecs Set rng = Range(spec(0)) With ws.Buttons.Add(rng.Left + rng.width * spec(1), rng.Top, _ rng.width * spec(2), rng.height) .name = spec(3) .OnAction = spec(4) .text = spec(5) End With Next ' Pair buttons (+, -) Dim btnPairs As Variant btnPairs = Array( _ Array("U14", Array("RES_S1", "RES_S2"), Array("S -", "S +"), 0.5), _ Array("U17", Array("RES_S3", "RES_S4"), Array("X -", "X +"), 0.5), _ Array("U18", Array("RES_S5", "RES_S6"), Array("Y -", "Y +"), 0.5), _ Array("U19", Array("RES_S7", "RES_S8"), Array("Z -", "Z +"), 0.5), _ Array("U29", Array("RES_CUST3", "RES_CUST4"), Array("1", ChrW(10148)), 0.5) _ ) Dim i As Integer For Each spec In btnPairs Set rng = Range(spec(0)) For i = 0 To 1 With ws.Buttons.Add(rng.Left + rng.width * (i * spec(3)), rng.Top, _ rng.width * spec(3), rng.height) .name = spec(1)(i) .OnAction = IIf(i = 0 And spec(0) = "U29", "CustomResolution1", _ IIf(i = 1 And spec(0) = "U29", "CustomResolution2", "SetResolution")) .text = spec(2)(i) End With Next Next ' SpinButtons Dim spinSpecs As Variant spinSpecs = Array( _ Array("U26", "RES_SpinnerB8L", 1, 30000, 30, 2), _ Array("U27", "RES_SpinnerB8R", 0, 30000, 1, 1) _ ) Dim spin As Object For Each spec In spinSpecs Set rng = Range(spec(0)) Set spin = ws.Spinners.Add(rng.Left, rng.Top, rng.width * 0.5, rng.height) With spin .name = spec(1) .LinkedCell = spec(0) '"$" & Replace(spec(0), "$", "") & "$" .Min = spec(2) .max = spec(3) .Value = spec(4) .SmallChange = spec(5) .OnAction = "Rotate" End With Next Set rng = Nothing Set ws = Nothing Range("U21").Select End Sub Sub CustomResolution1() ' 'Control panel for cells C7, C16, etc. (Field mode). Feb.2026 'Button for the user to customize their view of the field. 'Set scale Dim xS As Double xS = Range("E5").Value 'Set custom values. Change the values as desired. Range("U26").Value = 20 ' Range("U27").Value = 1 Range("AC15").Value = 10 ' Color value Range("AB19").Value = 2 ' Coordinate system Range("AA12").Value = 7 / xS ' x res (step) Range("AA13").Value = 7 / xS ' y res Range("AA14").Value = 7 / xS ' z res 'Refresh Rotate End Sub Sub CustomResolution2() 'Control panel for cells C7, C16, etc. (Field mode). Feb.2026 'Button to change the vector head Dim targetRow As Integer targetRow = Range("U11").Value + 7 Set btn = ActiveSheet.Buttons(Application.Caller) Select Case Cells(targetRow, 1).Value Case 4 Cells(targetRow, 1).Value = 6 btn.text = ChrW(9679) Case 6 Cells(targetRow, 1).Value = 1 btn.text = "--" Case 1 Cells(targetRow, 1).Value = 3 btn.text = ChrW(10147) Case 3 Cells(targetRow, 1).Value = 4 btn.text = ChrW(10148) Case Else Cells(targetRow, 1).Value = 4 btn.text = ChrW(10148) End Select Set btn = Nothing 'Refresh Rotate End Sub