Problema macro ir celda activa excel
Tengo la siguiente macro con la que tu me ayudaste:
Sub BuscarHoja()
Dim Nombrehoja As String, Cadena As String, MiCelda As String
If ActiveCell.End(xlUp).HasFormula = False Then
Cadena = ActiveCell.End(xlUp).Offset(-1, 0).MergeArea.Address
MiCelda = Left(Cadena, InStr(1, Cadena, ":") - 1)
Let Nombrehoja = ActiveCell.Text & "-" & Range(MiCelda).Text & "-" & Range("P2").Value
Sheets(Nombrehoja).Select
Else
Let Nombrehoja = ActiveCell.Text & "-" & ActiveCell.End(xlUp).Text & "-" & Range("P2").Value
Sheets(Nombrehoja).Visible = True
Sheets(Nombrehoja).Select
Sheets(Nombrehoja).Range("A1:L20").Select
ActiveWindow.zoom = True
Sheets(Nombrehoja).Range("b2").Select
Sheets(Nombrehoja).ScrollArea = "a1:j66"
End If
End SubPues bien, solo me funciona con la "hoja2" que seria de nombre (1-enero-2018). Con esta hoja funciona a la perfección, después de utilizarla con otra macro la oculto y vuelve a la hoja inicia, (calendario anual) y si vuelvo a repetir me dirige a ella aun estando oculta, me la muestra, y también me respeta el scrollArea que tengo. Esto solo lo hace con esta hoja.
Con el resto de hojas solo las encuentra si están visibles, si están ocultas me da error 400, y no me respeta scrollArea.
No se si habré hecho algo mal, supongo que si.
Respuesta de Abraham Valencia
1
