 
			
				25/10/2010, 09:14
			
			
			     |  
      |    |    |    Fecha de Ingreso: octubre-2010  
						Mensajes: 1
					  Antigüedad: 15 años Puntos: 0     |        |  
        buscar guardar con 2 o mas condiciones        hola amigos, tengo dos hojas en excell ,  en una la informacion de cada alumno por columna y con sus notas ejemplo: columna a1 nombre, b1 asignatura, c1 curso, d1 nota1, necesito algun codigo de excel macro vb para que en la hoja1 yo pueda poner curso y asignatura y me muestre los datos de los alumnos con sus notas que posean la asignatura y el curso que deseo, yo intente hacer este codigo pero algo anda mal xD     
Sub buscar_datos() 
Dim numero As Integer, curso As String, asignatura As String, rut As String, n1 As Integer   
numero = Range("a1").Value 
curso = Range("b338").Value 
rut = Range("d338").Value 
asignatura = Range("b339").Value   
Sheets("control").Select 
Range("as43").Select 
Do While ActiveCell.Value <> Empty   
If ActiveCell.Value = curso Then   
Range("as44").Select 
Do While ActiveCell.Value <> Empty   
If ActiveCell.Value = asignatura Then 
ActiveCell.Offset(0, 45).Select 
ActiveCell.Offset(0, 46).Select 
n1 = ActiveCell.Value 
n2 = ActiveCell.Value   
Sheets("Partes").Select 
Range("a343").Select 
Do While ActiveCell <> Empty 
ActiveCell.Offset(1, 0).Select 
ActiveCell.Value = numero 
ActiveCell.Offset(0, 1).Value = rut 
ActiveCell.Offset(0, 2).Value = nombre 
ActiveCell.Offset(0, 3).Value = asignatura 
ActiveCell.Offset(0, 4).Value = curso 
ActiveCell.Offset(0, 5).Value = n1 
ActiveCell.Offset(0, 6).Value = n2 
End If 
End If 
Exit Sub   
End Sub           |