Cubajz
06-19-2019, 01:27 AM
Hi,
I have this code which is not ideal:
Sub Find_cell_and_insert_HPageBreak ()
Selection.Find(What:="Příloha č.", After:=ActiveCell, LookIn:=xlFormulas _ , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate
If ActiveCell.EntireRow.Hidden Then
GoTo NEXT1
Else
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
NEXT1:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''
Selection.Find(What:="Příloha č.", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate
If ActiveCell.EntireRow.Hidden Then
GoTo NEXT2
Else
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
NEXT2:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''
End Sub
I continue with this into something like NEXT50: ...Can someone please help me to make this more sophisticated (its also slow: pray2:). Thank you:yes
I have this code which is not ideal:
Sub Find_cell_and_insert_HPageBreak ()
Selection.Find(What:="Příloha č.", After:=ActiveCell, LookIn:=xlFormulas _ , LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate
If ActiveCell.EntireRow.Hidden Then
GoTo NEXT1
Else
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
NEXT1:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''
Selection.Find(What:="Příloha č.", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate
If ActiveCell.EntireRow.Hidden Then
GoTo NEXT2
Else
ActiveWindow.SelectedSheets.HPageBreaks.Add Before:=ActiveCell
End If
NEXT2:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''
End Sub
I continue with this into something like NEXT50: ...Can someone please help me to make this more sophisticated (its also slow: pray2:). Thank you:yes