Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Leo Leo is offline
external usenet poster
 
Posts: 5
Default search question

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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to search my past question ? Eric Excel Discussion (Misc queries) 2 March 30th 07 02:38 PM
How to search my past question ? Eric Excel Worksheet Functions 1 March 30th 07 06:04 AM
Search Function Question IPerlovsky Excel Worksheet Functions 1 March 1st 07 05:21 AM
Search and Replace Question Rebecca New Users to Excel 1 April 11th 05 04:49 AM
Macro search replace question WDP[_2_] Excel Programming 1 August 28th 03 06:18 AM


All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"