P
Pawan
I am writing a macro for autofilter. The code is (taken from one community):
Dim FiltRng As Range
Worksheets(Choice).Cells.ClearContents
rng.AutoFilter Field:=Field, Criteria1:=Choice
On Error Resume Next
Set FiltRng = rng.SpecialCells(xlCellTypeVisible).EntireRow
On Error GoTo 0
FiltRng.Copy Worksheets(Choice).Range("A1")
Set FiltRng = Nothing
This code is taking search string from userform.
It is working fine to search exact cell contents. However I want to search
the records even if that word is part of the cell. e.g. if I write "Europe"
then it should also search the cells which have "Europe" word, even if there
are additionals words in the cell.
How can we do this?
Thank You
Regards,
Pawan
Dim FiltRng As Range
Worksheets(Choice).Cells.ClearContents
rng.AutoFilter Field:=Field, Criteria1:=Choice
On Error Resume Next
Set FiltRng = rng.SpecialCells(xlCellTypeVisible).EntireRow
On Error GoTo 0
FiltRng.Copy Worksheets(Choice).Range("A1")
Set FiltRng = Nothing
This code is taking search string from userform.
It is working fine to search exact cell contents. However I want to search
the records even if that word is part of the cell. e.g. if I write "Europe"
then it should also search the cells which have "Europe" word, even if there
are additionals words in the cell.
How can we do this?
Thank You
Regards,
Pawan