mostra en otra hoja los resultados
Publicado por mike (16 intervenciones) el 06/04/2009 18:10:51
Hola!! saben deseo mostrar en otra hoja los datos que tengo en la hoja INGRESOS mostralos en otra segun la fecha de busqueda tengo este codigo:
Private Sub CommandButton1_Click()
Dim FechaI As Date
Dim FechaF As Date
Dim format As String
Dim Dato1 As String
Dim Dato As Date
FechaI = TextBox1.Value 'Donde tu pondrias 01/02/2009
FechaF = TextBox2.Value 'Donde tu pondrias 12/04/2009
'MsgBox "El resultado es " & format(FechaF - FechaI, 0) & " dias"
If UserForm1.OptionButton2.Value = True Then
Dato1 = "Pequeña"
End If
If UserForm1.OptionButton3.Value = True Then
Dato1 = "Mediana"
End If
If UserForm1.OptionButton4.Value = True Then
Dato1 = "Grande"
End If
If UserForm1.OptionButton5.Value = True Then
Dato1 = "Licitación"
End If
ULT = Sheets("INGRESOS").Range("E65536").End(xlUp).Row - 1
If Dato1 = Empty Then
MsgBox "selecione un Dato", vbCritical
Exit Sub
Else
fila = 2
contador = 0
For X = 1 To ULT
Dato = Cells(fila, 5).Value
dato2 = Cells(fila, 15).Value
For w = FechaI To FechaF
If Dato = w And Dato1 = dato2 Then
contador = contador + 1
End If
Next w
fila = fila + 1
Next X
Label3 = "Existe " & contador & " proyectos " & Dato1
End If
End Sub
que me cuenta los datos que tengo pero no c como hacer que los muestre los que cuenta en otra hoja!!
como lo hago para traspasar los datos que encuentra a otra hoja???
gracias.
Private Sub CommandButton1_Click()
Dim FechaI As Date
Dim FechaF As Date
Dim format As String
Dim Dato1 As String
Dim Dato As Date
FechaI = TextBox1.Value 'Donde tu pondrias 01/02/2009
FechaF = TextBox2.Value 'Donde tu pondrias 12/04/2009
'MsgBox "El resultado es " & format(FechaF - FechaI, 0) & " dias"
If UserForm1.OptionButton2.Value = True Then
Dato1 = "Pequeña"
End If
If UserForm1.OptionButton3.Value = True Then
Dato1 = "Mediana"
End If
If UserForm1.OptionButton4.Value = True Then
Dato1 = "Grande"
End If
If UserForm1.OptionButton5.Value = True Then
Dato1 = "Licitación"
End If
ULT = Sheets("INGRESOS").Range("E65536").End(xlUp).Row - 1
If Dato1 = Empty Then
MsgBox "selecione un Dato", vbCritical
Exit Sub
Else
fila = 2
contador = 0
For X = 1 To ULT
Dato = Cells(fila, 5).Value
dato2 = Cells(fila, 15).Value
For w = FechaI To FechaF
If Dato = w And Dato1 = dato2 Then
contador = contador + 1
End If
Next w
fila = fila + 1
Next X
Label3 = "Existe " & contador & " proyectos " & Dato1
End If
End Sub
que me cuenta los datos que tengo pero no c como hacer que los muestre los que cuenta en otra hoja!!
como lo hago para traspasar los datos que encuentra a otra hoja???
gracias.
Valora esta pregunta


0