asdasdasd

Páginas: 2 (418 palabras) Publicado: 27 de junio de 2013
Dim R As Range
Set R = ActiveSheet.Range("A10:B15")
R.Value = "Hola"
R.Font.Bold = True
________________________________________

Sub Condicional()
ActiveSheet.Range("A1").Value = 0 ' Ponerlas casillas donde se guardan los valores 0.
ActiveSheet.Range("A2").Value = 0
ActiveSheet.Range("A3").Value = 0
ActiveSheet.Range("A1").Value = Val(InputBox("Entrar el valor", "Entrar"))
' Si elvalor de la casilla A1 es mayor que 1000, entonces, pedir un segundo valor
If ActiveSheet.Range("A1").Value > 1000 Then
ActiveSheet.Range("A2").Value = Val(InputBox("Entrar valor2", "Entrar"))
EndIf
ActiveSheet.Range("A3").Value = ActiveSheet.Range("A1").Value - _
ActiveSheet.Range("A2").Value
End Sub
________________________________

Sub Condicional2()
If ActiveSheet.Range("A1").Value =ActiveSheet.Range("A2").Value Then
ActiveSheet.Range("A1").Font.Color = RGB(0, 0, 255)
ActiveSheet.Range("A2").Font.Color = RGB(0, 0, 255)
End If
End Sub________________________________________









Sub Condicional_Else()
Dim Precio As Single
Dim Descuento As Single
Precio = 0
Precio = Val(InputBox("Entrar el precio", "Entrar"))
' Si el valor de la variable precio esmayor que 1000, entonces, aplicar descuento del 10%
If Precio > 1000 Then
Descuento = Precio * (10 / 100)
ActiveSheet.Range("A2").Value = 0,1
Else ' Si no Aplicar descuento del 5%
Descuento =Precio * (5 / 100)
ActiveSheet.Range("A2").Value = 0,05
End If
ActiveSheet.Range("A1").Value = Precio
ActiveSheet.Range("A3").Value = Descuento
ActiveSheet.Range("A4").Value = Precio - Descuento
EndSub

_______________________________










Sub Logico_Y()
Dim Producto As String
Dim Cantidad As Integer
Dim Precio As Single
Dim Total As Single
Dim Descuento As Single
DimTotal_Descuento As Single
Precio = 0
Producto = InputBox("Entrar Nombre del Producto","Entrar")
Precio = Val(InputBox("Entrar el precio", "Entrar"))
Precio = Val(InputBox("Entrar la cantidad",...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Asdasdasd
  • Asdasdasdas
  • Asdasdasd
  • Asdasdasdad
  • asdasdasd
  • Asdasdasd
  • asdasdasd
  • asdasdasd

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS