B
bartman1980
I've made this code but with this line he gives an error because the
types of rng5 doesn't match.
If Not rng5 Is Nothing Or rng5 Is "a" Then
Does somebody know how I can combine the 2 functions with the OR?
This is my code:
Dim Walternatief As Long
Dim Wbenodigde As Long
Dim rng5 As Range
Range("A:A").Select
Selection.Find(What:="alternatief", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Select
Walternatief = Selection.Row
Dim rng4 As Range
On Error Resume Next
Set rng4 = ActiveSheet.Range("F" & WOptioneel + 1 & ":F" &
Walternatief - 6).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng4 Is Nothing Then
rng4.EntireRow.Delete
End If
Range("A:A").Select
Selection.Find(What:="Benodigde", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Select
Wbenodigde = Selection.Row
On Error Resume Next
Set rng5 = ActiveSheet.Range("F" & Walternatief + 1 & ":F" &
Wbenodigde - 1).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng5 Is Nothing Or rng5 Is "a" Then
rng5.EntireRow.Delete
End If
types of rng5 doesn't match.
If Not rng5 Is Nothing Or rng5 Is "a" Then
Does somebody know how I can combine the 2 functions with the OR?
This is my code:
Dim Walternatief As Long
Dim Wbenodigde As Long
Dim rng5 As Range
Range("A:A").Select
Selection.Find(What:="alternatief", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Select
Walternatief = Selection.Row
Dim rng4 As Range
On Error Resume Next
Set rng4 = ActiveSheet.Range("F" & WOptioneel + 1 & ":F" &
Walternatief - 6).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng4 Is Nothing Then
rng4.EntireRow.Delete
End If
Range("A:A").Select
Selection.Find(What:="Benodigde", After:=ActiveCell,
LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False) _
.Select
Wbenodigde = Selection.Row
On Error Resume Next
Set rng5 = ActiveSheet.Range("F" & Walternatief + 1 & ":F" &
Wbenodigde - 1).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng5 Is Nothing Or rng5 Is "a" Then
rng5.EntireRow.Delete
End If