Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Application
El propio Excel.
Propiedades
[Tipo, Lectura/Escritura]
.Caption
.DisplayAlerts
.Path
.ScreenUpdating
.WindowState
.DisplayStatusBar
.DisplayFormulaBar
[String, L/E]
[Boolean, L/E]
[String, L]
[Boolean, L/E]
[L/E]
[Boolean, L/E]
[Boolean, L/E]
Mtodos Argumentos
.Calculate
.Help
.Quit
.Run
[] Recalcula todas las frmulas, de todas las hojas, de todos los libros abiertos.
[String, Integer] Muestra un tema de ayuda.
[] Cierra Excel.
[String, ...] Ejecuta una Subrutina con sus argumentos si los lleva.
Ninguno
HelpFile, HelpContextId
Ninguno
Macro, arg1, arg2, ...
Workbooks
ThisWorkbook
ActiveWorkbook
Workbooks("Libro1.xls")
Workbooks(1)
Workbooks(Workbooks.Count)
Propiedades
[Tipo, L/E]
.Name
.Path
.Count
.Author
.Saved
[String, L]
[String, L]
[Integer, L]
[String, L/E]
[Boolean, L]
Mtodos
Argumentos
.Open
.Add
.Activate
.Close
.Protect
.Save
.SaveAs
.SaveCopyAs
FileName, ReadOnly
[String, Bool] Abre un libro existente: FileName:="c:\dir\libro.xls"
Ninguno
[] Crea un nuevo libro vaco y lo agrega a la coleccin.
Ninguno
[] Activa el libro especificado.
SaveChanges, FileName
[Bool, String] Cierra el libro, y lo guarda con un nombre si True.
Password, Structure, Windows [String, Bool, Bool] Protege el libro, estructura y ventanas.
Ninguno
[] Guarda el libro, con el nombre actual.
FileName
[String] Guarda el libro, con un nuevo nombre.
FileName
[String] Guarda una copia del libro, con un nuevo nombre.
Worksheets
ActiveSheet
Worksheets("Hoja1")
Worksheets(1)
Worksheets(Worksheets.Count)
Hoja activa.
(Ejemplo: NombreHoja = ActiveSheet.Name )
Hoja llamada "Hoja1".
Primera hoja de la coleccin. (Ej: NombreHoja = Worksheets(1).Name )
ltima hoja de la coleccin.
Propiedades
[Tipo, L/E]
.Name
.Index
.Count
.Next
.UsedRange
[String, L/E]
[Integer, L]
[Integer, L]
[Worksheet, L]
[Range, L]
Nombre de la Hoja.
Devuelve el ndice nmerico de la hoja dentro de la coleccin de hojas.
Devuelve el nmero de hojas de la coleccin.
Devuelve la siguiente hoja. (.Previous) la anterior.
Devuelve un objeto Range con el rango de la hoja que tiene datos.
__________________________________________________________________________________________________________________________
2001 Joaqun Caselles - Curso de Visual Excel (Ver. 2.3 Sep 2008)
vexcel.jjcaselles.com - vexcel.coninteres.es
Mtodos
Argumentos
.Activate
.Calculate
.Delete
.Protect
.Paste
Ninguno
Ninguno
Ninguno
Password
Destination
Range
Range("B3")
Range("C2:D3")
Range("NombreRango")
ActiveCell
Propiedades
Sintaxis: Range().Propiedad
[Tipo, L/E]
.Count
[Integer, L]
.Dependents
[Range, L]
.Name
[String, L/E]
.Value
[Cualquiera, L/E]
.Formula
[String, L/E]
.Text
[String, L]
.NumberFormat [String, L/E]
.Font
[Object, L/E]
.Interior
[Object, L/E]
.EntireRow
[Range, L]
.EntireColumn [Range, L]
.Offset(RowOffset, ColumnOffset)
Mtodos
Argumentos
.Select
.Activate
.Calculate
.Copy
.PasteSpecial
.Delete
.ClearContents
Ninguno
Ninguno
Ninguno
Destination
[Varios Opcionales]
Shift
Ninguno
Type TipoPersonal
Campo1 As Tipo
Campo2 As Tipo
End Type
' <-- Despus de una comilla simple todo es un Comentario aclaratorio y aparece en verde.
Sub NombreRutina(ByVal Arg1 As Tipo, ByRef Arg2 As Tipo, Optional ByRef Arg3opc As Variant)
Const Constante1
As Tipo = Valor
' Declara una Constante y le asigna el valor Valor.
Dim Variable1
As Tipo
' Declara una Variable de tipo Tipo.
Dim Array1(5, 8) As Tipo
' Declara un Array de 5 x 8 datos del tipo Tipo. Hasta 60 dimensiones.
Dim Array1(3 to 7) As Tipo
' Declara un Array de 5 datos (del 3 al 7) del tipo Tipo.
Array1(3,7) = Valor
Variable1 = NombreFuncin(Arg1, Arg2)
Call NombreRutina2(Arg1, Arg2)
NombreRutina2 Arg1, Arg2
Cdigo : Ms codigo : Cdigo largo que
no cabe en la lnea anterior
End Sub
Tipos de Datos
Nombre
Boolean
String
Byte
Integer
Long
Single
Double
Currency
Decimal
Date
Object
Variant
Tamao Contenido
2 bytes
1 byte Cadena
1 byte Bytes
2 bytes Enteros
4 bytes Enteros largos
4 bytes Reales
8 bytes Reales
8 bytes Moneda
14 bytes Reales largos
8 bytes Fecha y Hora
4 bytes Objeto
16 bytes Variante
If Condicin Then
Cdigo Si Condicin es Cierta
Else
Cdigo Si Condicin es Falsa
End If
If Condicin Then Cdigo Si Condicin es Cierta
If Condicin 1 Then
Cdigo Si Condicin 1 es Cierta
ElseIf Condicin 2 Then
Cdigo Si Condicin 1 es Falsa y
Condicin 2 es Cierta
End If
While Condicin
Cdigo mientras Condicin sea Cierta
Wend
Do While Condicin
Cdigo mientras Condicin sea Cierta
Loop
Do Until Condicin
Cdigo hasta que Condicin sea Cierta
Loop
Do
se
Referencias Abreviadas
With Objeto
.Propiedad = Valor
With .SubObjeto
.Mtodo = Valor
End With
End With
__________________________________________________________________________________________________________________________
2001 Joaqun Caselles - Curso de Visual Excel (Ver. 2.3 Sep 2008)
vexcel.jjcaselles.com - vexcel.coninteres.es