Hi,
In my vba i need to copy data. I do this using the auto filters. However, when it returns no data i need it to jump the next bit of code by ising an IF statement.
I have tried a few methods, the below being the last but cannot get it recognise no data returned ( i have names sheets 'we' and 'wf' ):-
Thanks in advance
Blunder
In my vba i need to copy data. I do this using the auto filters. However, when it returns no data i need it to jump the next bit of code by ising an IF statement.
I have tried a few methods, the below being the last but cannot get it recognise no data returned ( i have names sheets 'we' and 'wf' ):-
Code:
we.UsedRange.AutoFilter field:=4, Criteria1:="NOK"
Set rng = we.UsedRange.Offset(1, 0).SpecialCells(xlCellTypeVisible)
If Not rng Is Nothing Then
we.Range("a1:a" & Cells(Rows.Count, "a").End(xlUp).Row).Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy Destination:=wf.Range("a65536").End(xlUp).Offset(1, 0)
End If
Thanks in advance
Blunder