ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

JORNADA PFS Macros


Enviado por   •  6 de Julio de 2017  •  Trabajos  •  2.503 Palabras (11 Páginas)  •  188 Visitas

Página 1 de 11

PROF. PABLO MIGUEL ALVAREZ MORALES

JORNADA PFS

CICLO 2017

Comando set:

Set utiliza para crear un constante es decir se le asigna a una variable el valor ya sea numérico o alfanumérico.

Este valor nunca cambiara será siempre el mismo por ejemplo

 Set A= Activisheet

 

A la variable A se le asigna el valor constante de la palabra reservada activesheet, cada vez que aparezca la letra A representara el valor asignado.

Analice los macros, cópielos en su cuaderno y luego paselos a la computadora.

Realice un macro que permita el ingreso de 8 números los cuales se operaran de dos en dos en suma, resta multiplicación y división

 

Sub suma()

Dim n1 As Integer, n2 As Integer, n3 As Integer

Dim n4 As Integer, n5 As Integer, n6 As Integer

Dim n7 As Integer, n8 As Integer

Dim s As Integer, r As Integer, m As Integer

Dim d As Double

Set a = ActiveSheet

a.Range("B4").Value = "Suma"

a.Range("d4").Value = "Resta"

a.Range("f4").Value = "Multiplicacion"

a.Range("h4").Value = "Division"

a.Range("b5").Value = "Numero 1"

a.Range("b6").Value = "Numero 2"

a.Range("b7").Value = "total"

a.Range("d5").Value = "Numero 3"

a.Range("d6").Value = "Numero 4"

a.Range("d7").Value = "total"

a.Range("f5").Value = "Numero 5"

a.Range("f6").Value = "Numero 6"

a.Range("h5").Value = "Numero 7"

a.Range("h6").Value = "Numero 8"

a.Range("h7").Value = "total"

n1 = InputBox("ingrese primer numero")

a.Range("c5").Value = n1

n2 = InputBox("ingrese segundo numero")

a.Range("c6").Value = n2

n3 = InputBox("ingrese tercer numero")

a.Range("e5").Value = n3

n4 = InputBox("ingrese cuarto numero")

a.Range("e6").Value = n4

n5 = InputBox("ingrese quinto numero")

a.Range("g5").Value = n5

n6 = InputBox("ingrese  Sexto numero")

a.Range("g6").Value = n6

n7 = InputBox("ingrese Septimo numero")

a.Range("i5").Value = n7

n8 = InputBox("ingrese Octavo numero")

a.Range("i6").Value = n8

s = n1 + n2

a.Range("c7").Value = s

r = n3 - n4

a.Range("e7").Value = r

m = n5 * n6

a.Range("g7").Value = m

d = n7 / n8

a.Range("i7").Value = d

End Sub

Realice un macro que le permita realizar las funciones de una planilla mensual.

Sub planilla()

Dim n As String, p As String

Dim sb As Double, b As Double, sx As Double, o As Double, i As Double

Dim it As Double, itc As Double, ban As Double, an As Double, td As Double

Dim sl As Double

Dim hx As Integer

Set A = ActiveSheet

A.Range("a4").Value = "NOMBRE"

A.Range("B4").Value = "PUESTO"

A.Range("C4").Value = "SUELDO BASE"

A.Range("D4").Value = "BONIFICACION"

A.Range("E4").Value = "HORAS EXTRAS"

A.Range("F4").Value = "SUELDO EXTRA"

A.Range("G4").Value = "ORDINARIO"

A.Range("H4").Value = "IGSS"

A.Range("I4").Value = "IRTRA"

A.Range("J4").Value = "INTECAP"

A.Range("K4").Value = "BANTRAB"

A.Range("L4").Value = "ANTICIPOS"

A.Range("M4").Value = "TOTAL DESC"

A.Range("N4").Value = "SUELDO LIQ"

n = InputBox("INGRESE NOMBRE DEL TRABAJADOR", "PLANILLA DE PABLO")

A.Range("A5").Value = n

p = InputBox("INGRESE PUESTO DEL TRABAJADOR", "PLANILLA DE PABLO")

A.Range("B5").Value = p

sb = InputBox("INGRESE SUELDO BASE", "PLANILLA DE PABLO")

A.Range("C5").Value = sb

b = InputBox("INGRESE BONIFICACION", "PLANILLA DE PABLO")

A.Range("D5").Value = b

hx = InputBox("INGRES HORAS EXTRAS", "PLANILLA DE PABLO")

A.Range("E5").Value = hx

an = InputBox("INGRESE LOS ANTICIPOS O DESCUENTOS", "PLANILLA DE PABLO")

A.Range("L5").Value = an

sx = ((sb / 30) / 8) * 1.5 * hx

o = sb + b + sx

i = (sb * 4.83) / 100

it = (sb * 1) / 100

itc = (sb * 1) / 100

ban = (sb * 0.5) / 100

td = i + itc + ban + an

sl = o - td

A.Range("F5").Value = sx

A.Range("G5").Value = o

A.Range("H5").Value = i

A.Range("I5").Value = it

A.Range("J5").Value = itc

A.Range("K5").Value = ban

A.Range("M5").Value = td

A.Range("N5").Value = sl

End Sub

Realice un macro que le permita realizar la función de una factura de cinco artículos

Sub factura()

Dim n As String, f As String, d As String, ni As String

Dim c1 As Integer, c2 As Integer, c3 As Integer

Dim a1 As String, a2 As String, a3 As String, a4 As String, a5 As String

Dim p1 As Double, p2 As Double, p3 As Double, p4 As Double, p5 As Double

Dim co1 As Double, co2 As Double, co3 As Double, co4 As Double, co5 As Double

Dim st As Double, i As Double, tot As Double

Set a = ActiveSheet

a.Range("a6").Value = "Nombre"

a.Range("e6").Value = "Fecha"

a.Range("a8").Value = "Dirección"

a.Range("e8").Value = " Nit"

a.Range("a10").Value = "Cantidad"

a.Range("c10").Value = "Descripción"

a.Range("e10").Value = "Precio"

a.Range("f10").Value = "Compra"

a.Range("e16").Value = "Subtotal"

a.Range("e17").Value = "Iva"

a.Range("e18").Value = "Total"

n = InputBox("ingrese nombre del cliente", "Factura")

a.Range("b6").Value = n

f = InputBox("ingrese fecha", "Factura")

a.Range("f6").Value = f

d = InputBox("ingrese dirección ", "Factura")

a.Range("b8").Value = d

ni = InputBox("ingrese número de nit", "Factura")

a.Range("f8").Value = ni

c1 = InputBox("ingrese cantidad del primer articulo", "factura articulo 1")

...

Descargar como (para miembros actualizados)  txt (14.4 Kb)   pdf (47.4 Kb)   docx (15.5 Kb)  
Leer 10 páginas más »
Disponible sólo en Clubensayos.com