This is quite simple
Just paste this code into the userforms vba module.
Private Sub UserForm_Deactivate()
Columns("B:B").Select
Selection.Find(What:="Totalt:", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
TR = ActiveCell.Row
LR = Selection.SpecialCells(xlCellTypeLastCell).Row
Rows(TR + 1 & ":" & Application.Max(LR, TR + 1)).EntireRow.Delete
Rows(3 & ":" & Application.Max(TR - 1, 3)).EntireRow.Delete
End Sub
Bookmarks