Como filtrar información y copiar en otra hoja de excel con macro

Se me presentó un problema en la base de datos que realice para una agenda telefónica y que al abrir el archivo me muestre el nombre y apellidos del contacto que está cumpliendo año ese día; es decir, es un filtrado dinámico.

Puedo enviar el archivo para que un experto me ayude, se lo agradezco...

Este es la parte donde me muestra el error

Private Sub Workbook_Open()
Dim cuenta As Double
Dim user1 As String
Dim i As Integer
Dim nombre As String
Dim apellido As String
Dim contara As Double
'Al abrirse el archivo, este seleccionara la hoja plataforma

Sheets("Hoja1").Activate
Range("a1").Activate
Sheets("Hoja1").Range("C2") = Date
'Cuando se habra, se filtrara la informacion desde la hoja Base para que esta se muestre en la hoja plataforma.
' AQUI ME MUESTRA EL ERROR Y NO FILTRA LA INFORMACION
Sheets("Hoja2").Columns("A:F").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("A1:B2"), CopyToRange:=Range("Hoja1!Extract"), _
Unique:=False
'Este codigo es para contar la cantidad de datos filtrados en la hoja plataforma.

cuenta = Application.WorksheetFunction.CountA(Sheets("Hoja1").Range("d2:d65536"))

If Range("D2") = Empty Then
MsgBox "HOLA" & " " & UCase(Application.UserName), vbInformation, "SALUDO"

MsgBox "HOY NO TENEMOS REPORTES DE CUMPLEAÑEROS", vbInformation, "*SIN CUMPLEAÑOS*"

ElseIf cuenta = 1 Then
MsgBox "HOLA" & " " & UCase(Application.UserName), vbInformation, "SALUDO"
MsgBox " HOY TENEMOS" & " " & cuenta & " " & " CUMPLEAÑO", vbExclamation, "**CUMPLEAÑO**"

ElseIf cuenta > 1 Then
MsgBox "HOLA" & " " & UCase(Application.UserName), vbInformation, "SALUDO"

MsgBox " HOY TENEMOS" & " " & cuenta & " " & " CUMPLEAÑOS", vbExclamation, "**CUMPLEAÑOS**"

End If

'Bucle que mostrara en detalle quienes son los cumpleañeros.
For i = 1 To cuenta
nombre = Cells(i + 1, 4)
apellido = Cells(i + 1, 5)
MsgBox (nombre & " " & apellido), vbInformation, "***FELIZ CUMPLEAÑOS***"
Next i

End Sub

Añade tu respuesta

Haz clic para o