Sub
ScanValuesAndStoppIt_2()
Dim
rng
As
Range
Dim
strSearchValue
As
String
Dim
bSearchStart
As
Boolean
bSearchStart =
True
strSearchValue = InputBox(
"Welcher Wert wird gesucht?"
)
For
Each
rng
In
ActiveSheet.UsedRange.Cells
If
bSearchStart
Then
If
rng.Address = ActiveCell.Address
Then
bSearchStart =
Not
bSearchStart
End
If
Else
If
rng.Value = strSearchValue
Then
With
rng.Offset(rowOffset:=1)
.
Select
.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
End
With
Exit
For
End
If
End
If
Next
End
Sub
Sub
ScanValuesAndStoppIt_1()
Dim
rng
As
Range
Dim
strSearchValue
As
String
strSearchValue = InputBox(
"Welcher Wert wird gesucht?"
)
Set
rng = ActiveSheet.Cells.Find(What:=strSearchValue, LookIn:=xlValues, After:=ActiveCell, SearchDirection:=xlNext, MatchCase:=
True
)
If
Not
rng
Is
Nothing
Then
With
rng.Offset(rowOffset:=1)
.
Select
.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
End
With
End
If
End
Sub