#1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default very urgent



how can i find 2 cells at the same time. like i want to
search if Cell in column "A" has "Singpaore" and Cell in
column "B" has "MAL"

thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default very urgent

how can i find 2 cells at the same time. like i want to
search if Cell in column "A" has "Singpaore" and Cell in
column "B" has "MAL"



if several agreements to be searched you can use the Advanced Filter in
Data | Filter | Advanced Filter.
Your List range incl. headings is maybe in A1:B50.
Then write e.g. within the range D1:E2 the headings and the filter criteria.
You can filter in same place or copy the result to another place.
Record this action with the Macro recorder, in order to receive the syntax for the VBA code.


--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default very urgent

I understand you can do MATCH using an array formula, or something along
those lines. Maybe someone else can provide that example, if you're in fact
after a worksheet formula.

Since it's a programming question, here's one approach using VBA:

Sub test()
Dim i As Long

With ActiveSheet
For i = 1 To 1000
If .Cells(i, 1).Value = "Singapore" And .Cells(i, 2).Value =
"MAL" Then
MsgBox "found at row " & i
Exit For
End If
Next
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


wrote in message
...


how can i find 2 cells at the same time. like i want to
search if Cell in column "A" has "Singpaore" and Cell in
column "B" has "MAL"

thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default very urgent

The following code assumes that there is potentially more
than one instance of Singapore and "MAL" to find. The
code is designed to be case insensitive and is designed to
work if there are leading and/or trailing spaces included
(i.e. will accomodate sloppy typing).

Sub FindSingapore()
Dim Rng1 As Range, Rng2 As Range
Dim C As Range

Set Rng1 = Columns("A")
For Each C In Rng1.SpecialCells(xlCellTypeConstants)
If LCase(Trim(C)) = "singapore" And _
LCase(Trim(C.Offset(, 1))) = "mal" Then
Set Rng2 = Range(C, C.Offset(, 1))
'Do something ...
'Next two lines just demo that cells identified
Rng2.Select
MsgBox Rng2.Address
End If
Next
End Sub

Regards,
Greg

-----Original Message-----


how can i find 2 cells at the same time. like i want to
search if Cell in column "A" has "Singpaore" and Cell in
column "B" has "MAL"

thanks
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default very urgent

A subject line like "very urgent" is not only NOT necessary here as all are
treated as urgent but it is not productive for the archives.

--
Don Guillett
SalesAid Software

wrote in message
...


how can i find 2 cells at the same time. like i want to
search if Cell in column "A" has "Singpaore" and Cell in
column "B" has "MAL"

thanks



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
IME MODE FOR EXCEL 2007 (URGENT URGENT) Stella Wong Excel Discussion (Misc queries) 1 August 23rd 08 11:16 PM
Urgent ..Need help Emilio Excel Discussion (Misc queries) 2 December 23rd 07 11:19 AM
Urgent-Urgent VBA LOOP Jeff Excel Discussion (Misc queries) 0 October 6th 05 05:46 PM
Macro help urgent urgent Dave Peterson[_3_] Excel Programming 0 September 4th 03 03:59 PM
Macro help urgent urgent chandra Excel Programming 0 September 4th 03 03:50 PM


All times are GMT +1. The time now is 05:39 AM.

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"