• Domingo 28 de Abril de 2024, 23:22

Autor Tema:  Aplicacioncita  (Leído 1485 veces)

RadicalEd

  • Moderador
  • ******
  • Mensajes: 2430
  • Nacionalidad: co
    • Ver Perfil
Aplicacioncita
« en: Lunes 8 de Noviembre de 2004, 20:19 »
0
HOLA CHICOS DE SOLOCODIGO, ESTOY HACIENDO UNA APLICACIONCITA PARA UNA AGENCIA DE TURISMO Y TENGO UNOS CUANTOS PROBLEMITAS; AQUI LOS PONGO:
1.) TENGO UN LISTBOX QUE ME GUARDA CIERTOS VALORES HASTA QUE NO SE ENVIA A LA HOJA DE EXCEL, EL PROBLEMA ES QUE ME IMPRIMA ESTOS VALORES EN DIFERENTES FILAS, SON 2 VALORES DIFERENTES, CONCEPTO Y VALOR, SE PUEDE GRABAR TODOS LOS VALORES POSIBLES, PERO CADA CONCEPT VA EN UNA COLUMNA DIFERENTE AL DEL VALOR.
2.) COMO HAGO PARA BORRAR UN VALOR YA AGREGADO EN ESTE LISTBOX

A VER SE ME OLVIDABA LA CONTRASEÑA ES MUNDOVIRTUAL ES MAYUSCULA
POR AHORA NO ME ACUERDO DE MAS

GRACIAS CHAO
El mensaje contiene 1 archivo adjunto. Debes ingresar o registrarte para poder verlo y descargarlo.
El pasado son solo recuerdos, el futuro son solo sueños

shakka

  • Miembro HIPER activo
  • ****
  • Mensajes: 679
  • Nacionalidad: cr
    • Ver Perfil
    • http://mbrenes.com
Re: Aplicacioncita
« Respuesta #1 en: Jueves 7 de Abril de 2005, 00:49 »
0
///////////////////////////////////////////////////////////////////////////////////////////////
1)
Primero que nada estas evaluando 2 textbox que existen Len(TxtMes.Text) = 0 Or Len(TxtAño.Text) = 0...

deberia ser ...
->son combobox ...Len(CmbMes.Text) = 0 Or Len(TxtAño.Text) = 0...

si no entendi mal quieres insertar registros en la hoja de modo que todos se ubiquen en la misma fila(registro) pero en diferente columna(campos) a excepcion de valor que iria igual que todos(en dif. columna pero tambien en dif. fila)
entonces cambia :

With ActiveCell
        .Value = TxtNombre & "         " & TxtNit
        .Offset(0, 1).Value = TxtDir
        .Offset(0, 2).Value = TxtTel
        .Offset(0, 3).Value = TxtCodSaler
        .Offset(0, 4).Value = TxtDia & "   " & TxtMes & "   " & TxtAño
        .Offset(0, 5).Value = LstConcept
        .Offset(0, 6).Value = TxtValor
    End With
End If
ActiveCell.Offset(1, 0).Activate

por esto:
(bueno yo las trabajo asi, no se porque un campo del mismo registro iria en otra fila pero bueno si lo ocupas asi esto lo hace)
    Worksheets("Hoja2").Activate
    Worksheets("Hoja2").Rows(2).Select
    Selection.EntireRow.Insert
    Selection.EntireRow.Insert
   
    With ActiveSheet
         'cells(fila,columns) lo puse a insertar en la 2 fila por si quieres
         'agregarle un encabezado en la primera fila
         'sino solo cambia cells(2,columna) por cells(1,...)
         'y       .Cells(3, 7) = TxtValor por   .Cells(2, 7) = TxtValor
      .Cells(2, 1) = TxtNombre & "         " & TxtNit
      .Cells(2, 2) = TxtDir
      .Cells(2, 3) = TxtTel
      .Cells(2, 4) = TxtCodSaler
      .Cells(2, 5) = TxtDia & "   " & TxtMes & "   " & TxtAño
      .Cells(2, 6) = LstConcept
      .Cells(3, 7) = TxtValor
    End With

/* como observacion coloca al inicio del codigo
    Option Explicit, eso te ahorrara muchos problemas por ejemplo con
    el tratamiento de las variables.
*/


///////////////////////////////////////////////////////////////////////////////////////////////
2)
/* primero determina que vas a eliminar */
utiliza la propiedad cboBox.RemoveItem indice

si necesitas algo mas avisa