Cunajz's code is dependent on the selection before it is run. So is this:
Sub Find_cell_and_insert_HPageBreak()
Dim rng As Range
With Selection
Set rng = .Find(What:="Příloha č.", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not rng Is Nothing Then
firstAddress = rng.Address
Do
If Not rng.EntireRow.Hidden Then ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=rng
Set rng = .FindNext(rng)
Loop While Not rng Is Nothing And rng.Address <> firstAddress
End If
End With
End Sub
Another way to avoid hidden cells is to get .Find to ignore them using LookIn:=xlValues instead of LookIn:=xlFormulas:
Sub Find_cell_and_insert_HPageBreak()
Dim rng As Range
With Selection
Set rng = .Find(What:="Príloha c.", After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext)
If Not rng Is Nothing Then
firstAddress = rng.Address
Do
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=rng
Set rng = .FindNext(rng)
Loop While Not rng Is Nothing And rng.Address <> firstAddress
End If
End With
End Sub