Essays.club - Ensayos gratis, notas de cursos, notas de libros, tareas, monografías y trabajos de investigación
Buscar

COMO SE HACE UN MACRO Y EN QUE CONSISTE UNA MACRO.

Enviado por   •  24 de Enero de 2018  •  823 Palabras (4 Páginas)  •  280 Visitas

Página 1 de 4

...

Selection.Copy

ActiveWindow.SmallScroll Down:=-3

ActiveCell.Offset(0, 2).Range("A1").Select

ActiveSheet.Paste

ActiveCell.Offset(2, -2).Range("A1:A3").Select

Application.CutCopyMode = False

Selection.ClearContents

ActiveCell.Offset(5, 0).Range("A1:A2").Select

Selection.Cut

ActiveCell.Offset(0, 1).Range("A1:A2").Select

ActiveSheet.Paste

End Sub

Sub caso3()

Range("B1").Select

ActiveCell.Value = 1

ActiveCell.Offset(1, 0).Select

ActiveCell.Value = 2

ActiveCell.Offset(1, 0).Select

ActiveCell.Value = 3

ActiveCell.Offset(1, 0).Select

End Sub

Sub ciclo()

For x = 1 To 100

ActiveCell.Value = x

ActiveCell.Offset(1, 0).Select

Next x

End Sub

Sub ciclo2()

For x = 2 To 2000 Step 2

ActiveCell.Value = x

ActiveCell.Offset(1, 0).Select

Next x

End Sub

Sub tabla()

For x = 1 To 20

ActiveCell.Value = "9*" & x & "=" & 9 * x

ActiveCell.Offset(1, 0).Select

Next x

End Sub

Sub cuadrado()

For x = 1 To 20

ActiveCell.Value = "El cuadrado de" & x & "es" & x * x

ActiveCell.Offset(1, 0).Select

Next x

End Sub

Sub caso4()

y = "franky"

x = InputBox("cual es su nombre")

'MsgBox ("hola" & " " & x)

If x = "franky" Then

MsgBox ("ya lo sabía")

Else

MsgBox ("Usted es un mentiroso, su nombre es" & " " & y)

End If

End Sub

Sub mult()

x = InputBox("¿que tabla quiere de multiplicar?")

For a = 1 To 20

ActiveCell.Value = x & "*" & a & "=" & a * x

ActiveCell.Offset(1, 0).Select

Next a

End Sub

Sub Otra()

Range("A1:f50").Value = "universidad"

End Sub

Sub anidado()

x = InputBox("Escriba un numero")

If x = 1 Then

MsgBox ("soy el uno")

Else

If x = 2 Then

MsgBox ("soy el dos")

Else

If x = 3 Then

MsgBox ("soy el tres")

Else

If x = 4 Then

MsgBox ("soy el cuatro")

Else

If x = 5 Then

MsgBox ("soy el cinco")

Else

If x = 6 Then

MsgBox ("soy el seis")

Else

MsgBox ("NUMERO DESCONOCIDO")

End If

End If

End If

End If

End If

End If

End Sub

05/04/16

Dimensionar una variable:

DIM “variable” AS STRING

“Variable” = 0

Ej:

DIM SUMATORIA AS INTEGER

Sumatoria = 1

Para insertar un nuevo módulo:

[pic 12]

Se pueden vincular tres tipos de procesos: Lineal, cíclicos y decisionales.

Es importante saber

...

Descargar como  txt (7 Kb)   pdf (59.8 Kb)   docx (17.6 Kb)  
Leer 3 páginas más »
Disponible sólo en Essays.club