miércoles, 20 de julio de 2016

FORMULARIO CON INPUT Y LABELS

<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css"
href="css/estilos.css">
<meta charset="utf-8">
</head>
<body>
<form action="guardar.php" method="post">
<label for="nombre">INGRESE SU NOMBRE</label>
<input type="text" name="nombre"
placeholder="ingrese su nombre"></input>
<label for="email">INGRESE SU CORREO</label>
<input type="email" name="correo"
placeholder="ingrese su correo"></input>
<label for="comentario">
ENCRIBA SU COMENTARIO</label>
<textarea type="text" name="comentario">
</textarea>
<button type="submit" value="comentario">
GUARDAR
</button>
</form>
</body>
</html>

lunes, 2 de mayo de 2016

insertar datos a excel VBA

PRIMERO HACER EL USERFORM1
BOTON CALCULAR O OPERAR

Private Sub CommandButton1_Click()
TextBox6.Text = Val(TextBox4.Text) * Val(TextBox5.Text)
End Sub

____________________________________________________
EN EL BOTON DONDE QUEREMOS GUARDAR LOS DATOS EN UNA HOJA DE EXCEL
SON LA FILA 1 COLUMNA SEGÚN EL ORDEN

Private Sub CommandButton2_Click()
registro
Sheets("datos").Select
ult = Cells(Rows.Count, 1).End(xlUp).Row
Cells(ult + 1, 1) = TextBox1.Text
Cells(ult + 1, 2) = TextBox2.Text
Cells(ult + 1, 3) = TextBox3.Text
Cells(ult + 1, 4) = TextBox4.Text
Cells(ult + 1, 5) = TextBox5.Text
Cells(ult + 1, 6) = TextBox6.Text

End Sub
________________________________________________________________________________

ESTE CODIGO SEGÚN EL MODULO A UTILIZAR
Sub registro()
IDPRODUCTO = UserForm1.TextBox1.Text
CATEGORIA = UserForm1.TextBox2.Text
PRODUCTO = UserForm1.TextBox3.Text
CANTIDAD_INGRESADA = UserForm1.TextBox4.Text
PRECIO_UNIT = Val(UserForm1.TextBox5.Text)
Total = Val(UserForm1.TextBox6.Text)

End Sub
_____________________________________________________________________________
PARA SALIR DEL USERFORM

Private Sub CommandButton4_Click()
End
End Sub
_______________________________________________________________________________
PROPIEDAD PARA LLAMAR UN FORMULARIO DESDE EXCEL
UserForm1.Show

miércoles, 20 de abril de 2016

option en php

<?
$nombre=$_POST['nombre'];
$opcion=$_POST['opcion'];

if($opcion=="pcc")
{
echo"<script>;location.href='peritos.html'</script>";
}
else if($opcion=="baco")
{
echo"<script>;location.href='baco.html'</script>";
}
else if($opcion=="merca")
{
echo"<script>;location.href='merca.html'</script>";
}
else if($opcion=="bad")
{
echo"<script>;location.href='bad.html'</script>";
}
else if($opcion=="pae")
{
echo"<script>;location.href='pae.html'</script>";
}

?>

select option

<html>
<head>
<title>formulario</title>
<meta charset="uft-8">
</head>
<body>
<form action="opciones.php" method="post">
<table border="2" width="400" align="center">
<tr>
<td colspan="2">
<center>
<img src="imagenes/icono.png" width="500" ></IMG>
</center>
</td>
</tr>
<tr>
<td>
INGRESE NOMBRE
</td>
<td>
<input type="text" name="nombre"></input>
</td>
</tr>
<tr>
<td>
SELECCIONE UNA CARRERA
</td>
<td>
<SELECT name="opcion">
<option value="baco">BACHILLERATO EN COMPUTACIÓN</OPTION>
<option value="merca">MERCADOTECNIA Y PUBLICIDAD</OPTION>
<option value="bad">BACHILLERATO EN DISEÑO GRAFICO</OPTION>
<option value="pcc">PERITO CONTADOR</OPTION>
<option value="pae">PERITO EN ADMINISTRACIÓN DE EMPRESAS</OPTION>
</SELECT>
</td>
</tr>
<TR>
<TD COLSPAN="2">
<button type="sumbit" value="INGRESAR">VER CARRERA</button>
</TD>
</TR>
</table>
</form>
</html>

lunes, 28 de marzo de 2016

IF ELSE Y CASE EN VBA EXCEL


CALCULANDO LA EDAD DE UNA PERSONA


_________________________________________________________________________________
Private Sub CommandButton1_Click()


If Val(TextBox1.Text) >= 18 Then
  TextBox2.Text = " mayor"
Else
TextBox2.Text = "menor"

End If
End Sub






EJEMPLO DE IF ELSE EN VBA EXCEL
________________________________________________

Private Sub CommandButton1_Click()

If Val(TextBox1.Text) = 1 Then
  TextBox2.Text = " HOY ES DIA LUNES"
Else
If Val(TextBox1.Text) = 2 Then
  TextBox2.Text = " HOY ES DIA MARTES"
Else
  If Val(TextBox1.Text) = 3 Then
  TextBox2.Text = " HOY DIA MIRCOLES"
Else
  If Val(TextBox1.Text) = 4 Then
  TextBox2.Text = " HOY DIA JUEVES"
  Else
  If Val(TextBox1.Text) = 5 Then
  TextBox2.Text = " HOY DIA VIERNES"
  Else
  If Val(TextBox1.Text) = 6 Then
  TextBox2.Text = " HOY DIA SABADO"
    Else
  If Val(TextBox1.Text) = 7 Then
  TextBox2.Text = " DOMINGO"
    Else
  TextBox2.Text = " ESE NUMERO DE DIA NO EXISTE INTENTE CON OTRO"

End If
End If
End If
End If
End If
End If
End If
End Sub










EJEMPLO DEL CASE EN VAB EXCEL
_____________________________________________________________

Private Sub CommandButton1_Click()

Select Case TextBox1.Text
Case 1:
TextBox2.Text = " HOY ES DIA LUNES"
Case 2:
TextBox2.Text = " HOY ES DIA MARTES"
Case 3:
TextBox2.Text = " HOY ES DIA MIERCOLES"
Case 4:
 TextBox2.Text = "HOY ES DIA JUEVES"
Case 5:
 TextBox2.Text = " HOY ES DIA VIERNES"
Case 6:
 TextBox2.Text = " HOY ES DIA SABADO"
Case 7:
TextBox2.Text = " HOY ES DIA DOMINGO"
Case Else
TextBox2.Text = " ESE DIA NO EXISTE"
End Select
End Sub



________________________________________
realice el siguiente ejercicio utilizando la condicion if else
si la compra es mayor a Q400 aplicar el 5% de descuento =0.05
de lo contrario el descuento es cero el total final reste total menos descuento

HACER OTRO PROGRAMA QUE CALCULE LA EDAD DE UNA PERSONA Y NOS MUESTRE SI ES MAYOR O MENOR DE EDAD















martes, 8 de marzo de 2016

condición if else

EJEMPLO UNO


If Val(TextBox1.Text) = 1 Then
  TextBox2.Text = "  ES DIA LUNES"
Else
If Val(TextBox1.Text) = 2 Then
  TextBox2.Text = " ES DIA MARTES"
Else
  If Val(TextBox1.Text) = 3 Then
  TextBox2.Text = " ES DIA MIRCOLES"
Else
  If Val(TextBox1.Text) = 4 Then
  TextBox2.Text = " ES DIA JUEVES"
  Else
  If Val(TextBox1.Text) = 5 Then
  TextBox2.Text = " ES DIA VIERNES"
  Else
  If Val(TextBox1.Text) = 6 Then
  TextBox2.Text = " ES DIA SABADO"
    Else
  If Val(TextBox1.Text) = 7 Then
  TextBox2.Text = " ES DIA DOMINGO"
    Else
  TextBox2.Text = " ESE NUMERO DE DIA NO EXISTE INTENTE CON OTRO"

End If
End If
End If
End If
End If
End If
End If