Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ALUMNO:
HORARIO:
MACROS
1. CONCEPTOLas macros son un grupo de instrucciones programadas bajo entorno vba (visual basi
cuya tarea principal es la automatización de tareas repetitivas y la resolución de cálculos complejos
Pdemos reapresentar a los macros en el siguiente imagen.
3. Grupo Codigo
En el grupo codigo detallamos el funcionamiento de sus comandos:
c) Seleccionar el boton aceptar, no olvidar que cuando aceptamos ya estamos grabando todos las acciones que realizam
en excel, se Realiza las siguientes instrucciones:
☺ Aplicar relleno azul, fuente rojo, Arial 16 Negrrita
☺ Bordes de cuadro gueso, combinar y centrar
Ejemplo:
☺ Teclear alt + F11 O Elegir el botó visual basic de la pestaña Desarrollador
☺ Se coloca el siguiente codigo
☺ Ejecutar la macro
OS
ajo entorno vba (visual basic para aplicaciones).
solución de cálculos complejos
a en la ficha Desarrollador.
Nota 1:
Nota 2:
Nota 3:
Promedio:
MONTO igv
1500 270
2800 504
19000 #VALUE!
12500 #VALUE!
VARIABLE
ES UN IDENTIFICADOR QUE ALMACENA UN VALOR
TIPO DE DATO:
ES LA FORMA DE AGRUPAR VARIABLES Y CONSTANTES
INTEGER: Numeros enteros
Long: Numeros enteros
SINGLE: Numero real
double: Numero real
date: Fecha
String: texto
EJEMPLO DE MACROS
sddfdf
EJEMPLO
1iNGRESAR LOS DATOS CON MACRO Y CALCULAR EL PROMEDIO Y ESTADO
Alumno:
Nota 1:
Nota 2:
Nota 3:
Promedio:
Estado
A
CODIGO APELLIDO Y NOMBRE OCUPACION AFP CATEGORIA BASICO
AB001 RAMOS ROJAS, JORGE Prof. Teoria EL ROBLE C 960
AB002 MONTERREY ROQUE, EDGAR Prof. Laboratorio NO AFILIADO D 720
AB003 ZALDIVAR ALVAREZ, MARIO Coor. General HORIZONTE A 1250
AB004 VARGAS CASTRO, MARCO Secretaria INTEGRA E 450
AB005 CHAHUARA CONDORI, JUAN Prof. Teoria LA UNION C 960
AB006 RODRIGUEZ FIGUEROA, ALEX Coor. Administrativo NO AFILIADO B 1060
AB007 CALENZANI GAMARRA, PEDRO Prof. Laboratorio EL ROBLE D 720
AB008 MARTINEZ NORABUENA, MARCO Prof. Teoria INTEGRA C 960
AB009 CARMONA RODRIGUEZ, VILMA Asistente EL ROBLE F 350
AB010 VIDAL VALVERDE, SOFIA Secretaria NO AFILIADO E 450
AB011 PITA VELASQUEZ, CARLOS Prof. Laboratorio INTEGRA D 720
AB012 MARTEL ROJAS, JACKELINE Prof. Laboratorio EL ROBLE D 720
AB013 PALACIOS BASAS, LUIS Prof. Teoria LA UNION C 960
AB014 MURILLO GOMEZ, LUZ Secretaria HORIZONTE E 450
AB015 PUENTE ARRIETA, JESSICA Asistente EL ROBLE F 350
AB016 MANRIQUE MEDINA, JUAN Prof. Laboratorio LA UNION D 720
AB017 SEGURA SANTISTEBAN, LUIS Prof. Teoria NO AFILIADO C 960
AB018 MERCADO ALARCON, MARTIN Prof. Teoria EL ROBLE C 960
AB019 QUEZADA MOGROVEJO, ANIBAL Prof. Laboratorio LA UNION D 720
AB020 ANCHANTE SEGURA, HUBERT Prof. Teoria NO AFILIADO C 960
Crear MACRO
IMPRIMIR
Opción Vista
Preliminar
RMATO3
ampo
no,
atico
no
atico
e
USO DE CODIGO DE PROGRAMACIÓN
Estructuras de programación
a. Estructura secuencial: Se aplica de forma directa, es decir siguiendo el orden de las instrucciones.
Sintaxis:
Instruccion A
Instruccion B
Instruccion c
............
Sintaxis:
Simple:
IF (Criterio) Then Instruccion Verdadero
Compuesto:
If (Criterio) Then
Instruccion Verdadera
ELSE
iNSTRUCCION fALSA
End If
Multiple
If (Criterio) Then
Instruccion Verdadera
ELSEIF (Criterio 2) Then
iNSTRUCCION Verdadera
ElseIf( Criterio N) Then
Instruccion Verdadera
Else
Instruccion Falsa
End If
e las instrucciones.
0
Casos Practicos
1. Macro que permite crear un Libro
ALUMNO PC EP EF PF OBSERVACION
sas 12 12 12 12.00 aprobado
Número 2 9
Resultado
3
Realizar el diseño y las macros para aplicar en el siguiente caso