kippiebla
05-08-2020, 01:55 PM
I am not a star in Excel and certainly a newbie in VBA. In the attached file you see in worksheet "Source" in column C different reviews. Among these reviews are also "Error" and "Not good". The "Copy" worksheet should be a copy of the "Source" worksheet, but the rows with "Error" and "False" should not be copied. These rows may be left empty, but it would even be better of it is possible to leave them out entirely so that only 4 rows remain in worksheet "Copy".
I have been sent a code that should do it. That code is:
Sub Ja()
With Sheets("bron").Range("A4:C11") 'je bron
.Parent.AutoFilterMode = False 'filter uitzetten in blad
.AutoFilter Field:=3, Criteria1:=Array("Ja", "Ja goed", "Ja ok", "nog een andere reden"), Operator:=xlFilterValues 'array met alles dat wel meemag
.Copy Sheets("Kopie").Range("E4") 'doorkopieren
.Parent.AutoFilterMode = False 'filter uitzetten
End With
End Sub
But now I don't know what to do with that code at all. Where to put it. Can anyone help?
I have been sent a code that should do it. That code is:
Sub Ja()
With Sheets("bron").Range("A4:C11") 'je bron
.Parent.AutoFilterMode = False 'filter uitzetten in blad
.AutoFilter Field:=3, Criteria1:=Array("Ja", "Ja goed", "Ja ok", "nog een andere reden"), Operator:=xlFilterValues 'array met alles dat wel meemag
.Copy Sheets("Kopie").Range("E4") 'doorkopieren
.Parent.AutoFilterMode = False 'filter uitzetten
End With
End Sub
But now I don't know what to do with that code at all. Where to put it. Can anyone help?