![Page 1: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/1.jpg)
LaboratorioInformática II
Clase 5Excel Controles Active XRepaso Macros
![Page 2: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/2.jpg)
Tablas
1. Modo diseño: permitirá trabajar en el diseño de los controles de ActiveX
2. Propiedades: permiten activar la propiedad de cada control 3. Ver código: permite agregar código a cada control.
![Page 3: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/3.jpg)
Ejercicio. Propiedades
1. Hacemos estas hojas:Menú, Ventas y Compras
2. En la hoja Manu:Inserte dos botones ActiveX
3. Cambie las propiedades de los dos botones:Cambie en propiedades Caption y Name
4.Ver codigo del boton y agregar segun correspondaHoja2.ActivateHacer lo mismo con el segundo
Desactivar modo disenio y probar
![Page 4: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/4.jpg)
Formulas Locales
Range("C3").FormulaLocal = "=SUMA(D6:D7)”
O
Range(“C3").Select ActiveCell.FormulaLocal = "=SUMA(D6:D7)"
![Page 5: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/5.jpg)
Insertar
Sub insertar()'' cambio Macro'' Acceso directo: CTRL+j' Sheets("Hoja1").Select Range("d6:f6").Select Selection.Copy Sheets("Hoja2").Select Range("d6:f6").Select ActiveSheet.Paste Selection.EntireRow.Insert End Sub
![Page 6: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/6.jpg)
Variables e Input
DIM variable AS tipo.
InputBox(Mensaje, Título, Valor por defecto, Posición horizontal, Posición Vertical, Archivo ayuda, Número de contexto para la ayuda).
Sub Entrar_Valor Dim Texto As String ' Chr(13) sirve para que el mensaje se muestre en dos Líneas Texto = InputBox("Introducir un texto " & Chr(13) & "Para la celda A1", "Entrada de datos") ActiveSheet.Range("A1").Value = Texto End Sub
![Page 7: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/7.jpg)
Variables
Sub Entrar_ValorDim Celda As StringDim Texto As String Celda = InputBox("En que celda quiere entrar el valor", "Entrar Celda") Texto = InputBox("Introducir un texto " & Chr(13) & "Para la celda " & Celda , "Entrada de datos") ActiveSheet.Range(Celda).Value = Texto End Sub
![Page 8: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/8.jpg)
Tipos de Datos
Byte
Boolean
Integer
Single
Date
String
![Page 9: Laboratorio Informática II Clase 5 Excel Controles Active X Repaso Macros](https://reader035.vdocumento.com/reader035/viewer/2022062315/5665b4801a28abb57c9209c7/html5/thumbnails/9.jpg)
Condicionales
If Condición Then Senténcia1 Senténcia2 . . SenténciaN
End If
Select Case signo Case "+“
Total = 10..Case Else
Total = 0 End Select