Sub Resumen()
'
' Resumen Macro
' Recorre todas las hojas ... y luego de las hojas cada columna promedio, si el valor no es numerico lo salto y los resultados lo pongo en la Hoja Resultado
'
' Acceso directo: CTRL+q
'
Dim WS_Count As Integer ' Con esto voy a revisar
Dim A, R As Integer ' Contadores de Aprobados Reprobados
Dim I As Integer 'contador de hojas
Dim C As Integer 'contador de registros de cada hoja
Dim K As Integer 'Contado de Registros hoja Resultado
Dim X As Integer 'Contador de las celdas promedio
Dim Y As Integer 'Contador de los registros de la hoja
Dim Salir As Boolean
Dim Salir2 As Boolean
' Set WS_Count equal to the number of worksheets in the active
' workbook.
WS_Count = ActiveWorkbook.Worksheets.Count
C = 65
B = 2
Y = 0
' Begin the loop.
For I = 1 To WS_Count
Debug.Print ActiveWorkbook.Worksheets(I).Name
Salir = False
If ActiveWorkbook.Worksheets(I).Name <> "RESULTADOS" Then
ActiveWorkbook.Worksheets(I).Select
'determinar Columna Promedio
X = 2
While C <= 90 And Salir = False
Y = 0
Debug.Print Range(Chr(C) & 1).Value
If Range(Chr(C) & 1).Value = "PROMEDIO" Then
Salir = True
'Si la columna Es el promedio ahora si comienzo
A = 0
R = 0
While X <= 100 And Range("C" & X).Value <> "" ' 100 por numero de empleados
Debug.Print Range("C" & X).Value
If Range(Chr(C) & X).Value >= 0 Then
Y = Y + 1
If Range(Chr(C) & X).Value >= 6 Then
A = A + 1
Else
R = R + 1
End If
X = X + 1
Else
X = X + 1
End If
Wend
Else
C = C + 1
End If
Wend
End If
Sheets("Resultados").Select
Range("A" & B).Value = ActiveWorkbook.Worksheets(I).Name
Range("B" & B).Value = A
Range("C" & B).Value = R
Range("F" & B).Value = Y
Range("D" & B).Value = (A / Y)
Range("E" & B).Value = (R / Y)
B = B + 1
Next I
End Sub