Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
I search data on worksheet by simpe code from Excel help: Sub Find_Complex() Worksheets(2).Cells.Clear With Worksheets(1).[a1:a500] TextForSearch = Worksheets(1).[b1] Set c = .Find(TextForSearch, LookIn:=xlValues) i = 1 If Not c Is Nothing Then firstAddress = c.Address Do Worksheets(2).Cells(i, 1) = c Set c = .FindNext(c) i = i + 1 Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub It works fine until I want find 2 values - one from [b1], and second - for example in [b2] - code must return values from data that contain [b1] OR [b2] ,e.g. if [b1]=1,[b2]=2 code must return all records from data with "1" and "2" to the same column on Worksheet(2) How can I modify Find method for 2 values ? Thank for help Leo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to search my past question ? | Excel Discussion (Misc queries) | |||
How to search my past question ? | Excel Worksheet Functions | |||
Search Function Question | Excel Worksheet Functions | |||
Search and Replace Question | New Users to Excel | |||
Macro search replace question | Excel Programming |